<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('系统管理员操作界面')"/>
    <!--<th:block th:include="include :: select2-css" />-->
    <th:block th:include="include :: bootstrap-select-css"/>
    <link th:href="@{/ruoyi/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/jquery-confirm.min.css}" rel="stylesheet"/>
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<style type="text/css">
    /**手机屏幕下显示***/
    @media screen and (max-width: 768px) {
        .gray-bg {
            height: auto;
            margin: auto;
        }

        .image {
            position: absolute;
            margin-top: -50px;
            margin-left: 50px;
            left: 55%;
            width: 30%;
        }

        .toudiv {
            width: 80%;
            float: right;
            margin-top: -10%;
        }

        .toulab {
            float: left;
        }

        .cddiv {
            margin: 0px auto;
        }

        .sjinput {
            width: 100%;
            margin: -35px 20px 0px 18px;
            float: left;
            font-size: 10px
        }

        .touinput {
            width: 10px;
            float: left;
        }

        .zbinput {
            margin-top: -35px;
            margin-left: 18px
        }

        .sjlab {
            margin: 0px 0px 0px -20px;
            font-size: 10px
        }

        .form-control, #whrq_id_bf {
            width: 100%;
            /**/
            background-color: #FFFFFF;
            float: left;
        }

        #sjdiv hr {
            display: none;
        }
    }

    /**电脑屏幕下显示***/
    @media screen and (min-width: 768px) {
        .gray-bg {
            height: auto;
            width: 70%;
            margin: auto;
        }

        .image {
            position: absolute;
            margin-top: -50px;
            margin-left: 200px;
            left: 55%;
        }

        #sbwhform {
            height: 220px;
            margin: 0px auto;
        }

        #weihr_div > #weihr_update_input_15 {
            margin-top: 15px;
            margin-left: -40px;
            background-color: #FFFFFF;
            border: none;
        }

        #weihr_lab {
            margin-top: 17px;
        }

        #gzyy_div {
            margin-left: -20px;
            margin-top: -10px;
        }

        #gzfl_div {
            margin-left: -20px;
            margin-top: -10px;
        }

        #selbm_div {
            margin-left: -20px;
            width: 165px;
            margin-top: -10px;
        }

        #shiyr_lab {
            margin-left: -30px;
        }

        #shiyr01 {
            margin-left: -20px;
            margin-top: -10px;
        }

        #add_yg {
            margin-left: -20px;
            background-color: #1e84c5;
            color: #FFFFFF;
        }

        #jjfa_div {
            margin-left: -20px;
            margin-top: -10px;
        }

        #add_jjfa_div {
            margin-left: -10px;
            margin-top: -10px;
        }

        #add_yg_div {
            margin-left: -10px;
            margin-top: -10px;
        }

        #add_jjfa {
            background-color: #1e84c5;
            color: #FFFFFF;
        }

        #sjdiv label {
            margin-left: -20px;
            margin-top: -20px;
        }

        #sjdiv input {
            margin-left: -15px;
            margin-top: -20px;
            background-color: #FFFFFF;
            border: none;
            border-bottom: 1px solid #e5e6e7;
        }

        #sjdiv hr {
            margin-top: -27px
        }

        #sjdiv {
            margin: 0px auto;
        }

        #fldiv1 {
            height: auto;
        }

        #fldiv2 {
            height: auto;
        }

        .top_lab {
            margin-top: -10px
        }

        .toudiv {
            width: 130px;
            margin-right: -20px;
        }

        .toulab {
            margin-right: -10px
        }

        .touinput {
            width: 130px
        }

        #ibox1 {
            margin-top: 18px
        }

        #ibox2 {
            margin-top: 18px
        }

        #whrq_id_bf {
            width: 120px;
            background-color: #FFFFFF;
        }

        #bfrq {
            margin-left: -30px;
        }

        #beizlab {
            margin-left: -30px;
        }

        #beiz1 {
            margin-left: -15px;
            width: 158px;
        }
    }

</style>
<body class="gray-bg">

<!--添加登录界面模态框开始-->
    <div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <!--                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span-->
                    <!--                            aria-hidden="true">&times;</span>-->
                    <!--                    </button>-->
                    <h4 class="modal-title" id="loginModalLabel">登录管理</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="tabs-container" style="height: 260px;">
                                <ul class="nav nav-tabs">
                                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 快捷登录</a>
                                    </li>
                                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">账号登录</a>
                                    </li>
                                </ul>
                                <div class="tab-content">
                                    <div id="tab-1" class="tab-pane active">
                                        <div class="panel-body" style="height: 235px;">
                                            <form class="form-horizontal">
                                                <div class="row">
                                                    <div class="form-group">
                                                        <label style="float: left;margin-left: 20px;margin-top: 5px">快登编号：</label>
                                                        <input type="text" placeholder="请输入用户名" id="getgsid" class="username form-control" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"/>
                                                    </div>
                                                </div>
                                            </form>
                                            <div style="float: right">
                                                <div class="row">
                                                    <div class="form-group">
                                                        <button type="button" class="btn btn-primary" onclick="kjdl()">登录</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div id="tab-2" class="tab-pane">
                                        <div class="panel-body" style="height: 235px;">
                                            <form class="form-horizontal">
                                                <div class="row">
                                                    <div class="form-group">
                                                        <label style="float: left;margin-left: 20px;margin-top: 5px">公司名称：</label>
                                                        <select class="gsid form-control" id="shoujigsid" name="gsid" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"></select>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="form-group">
                                                        <label style="float: left;margin-left: 20px;margin-top: 5px">用&nbsp&nbsp户&nbsp&nbsp名：</label>
                                                        <input type="text" id="shoujiusername" placeholder="请输入用户名" class="username form-control" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"/>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="form-group">
                                                        <label style="float: left;margin-left: 20px;margin-top: 5px">密&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp码：</label>
                                                        <input type="password" id="shoujipassword" placeholder="请输入密码" class="password form-control" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"/>
                                                    </div>
                                                </div>
                                            </form>
                                            <div style="float: right;">
                                                <div class="row">
                                                    <div class="form-group">
                                                        <button type="button" class="btn btn-primary" onclick="zcdl()">登录</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<!--添加登录界面模态框结束-->


<!--添加员工模态框开始-->
<div class="tjjjfa">
    <div class="modal fade" id="ygModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-sm" role="document">
            <div class="modal-content" style="padding-top: 50px;overflow:hidden">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="tjygModalLabel">人员管理</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group" style="display: none">
                            <label class="col-sm-3 control-label">部门id号(隐藏)</label>
                            <div class="col-sm-9">
                                <input type="text" name="bmid" class="form-control" id="yg_bmid"
                                       placeholder="请输入账户名">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">部门名称</label>
                            <div class="col-sm-9">
                                <input type="text" name="bmmc" class="form-control" id="yg_bmmc"
                                       placeholder="请输入账户名">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">姓名</label>
                            <div class="col-sm-3">
                                <input type="text" name="xingm" class="form-control" id="yg_xingm"
                                       placeholder="请输入员工姓名">
                                <span class="help-block"></span>
                            </div>
                            <div class="col-sm-3">
                                <input type="text" name="zjm" class="form-control" id="yg_zjm" disabled
                                       placeholder="请输入员工姓名">
                                <span class="help-block"></span>
                            </div>
                            <div class="col-sm-3">
                                <a class="btn btn-primary btn-rounded btn-sm" id="creat_zjm_btn">
                                    <i class="fa fa-search"></i>生成助记码</a>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="tj_yg_btn" onclick="tjyg()">添加</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--添加员工模态框结束-->

<!--添加解决方案模态框开始-->
<div class="tjjjfa">
    <div class="modal fade" id="tjjjfaModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-xl" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="tjModalLabel">添加解决方案</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group" style="display: none">
                            <label class="col-sm-2 control-label">生成ID</label>
                            <div class="col-sm-8">
                                <input type="text" name="gsid" class="form-control" id="gsid_jjfa"
                                       placeholder="请点击生成ID号">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2">故障分类</label>
                            <div class="col-sm-10">
                                <select name="gzfl" class="form-control m-b" id="gzfl">
                                </select>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2">故障原因</label>
                            <div class="col-sm-10">
                                <input name="gzyy" id="gzyy_fl" class="form-control" list="browsersforgzyy">
                                <datalist id="browsersforgzyy"></datalist>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2">解决方案</label>
                            <div class="col-sm-10">
                                <input type="text" name="jjfa" class="form-control" id="jjfa_name"
                                       placeholder="请输入解决方案">
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="tj_jjfa_btn" onclick="tjjjfa()">添加</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--添加解决方案模态框结束-->

<!--设备报废模态框开始-->
<div class="modal fade" id="sbbaofModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content cddiv" style="height: auto">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h3 class="modal-title" id="sbbfModalLabel"><strong>设备报废</strong></h3>
                <small>日期用总经理签字日期</small>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">公司ID号(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="gsid" class="form-control" id="gsid_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">维护类别(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="whlb" class="form-control" id="whlb_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">设备编号(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="sbbh" class="form-control" id="sbbh_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">故障原因(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="gzyy" class="form-control" id="gzyy_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">解决方案(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="jjfa" class="form-control" id="jjfa_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">维护人(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="weihr" class="form-control" id="weihr_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">维护记录(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="whjl" class="form-control" id="whjl_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">部门名称(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="bm" class="form-control" id="bm_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">原部门名称（隐藏）</label>
                        <div class="col-sm-8">
                            <input type="text" name="ybm" class="form-control" id="ybm_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">使用人(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="shiyr" class="form-control" id="shiyr_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">原使用人(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" name="yshiyr" class="form-control" id="yshiyr_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-4 control-label">购买日期(隐藏)</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="gmrq_bf"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <!--<div class="form-group">-->
                    <!--<label class="col-sm-4 control-label">报废申请编号</label>-->
                    <!--<div class="col-sm-8">-->
                    <!--<input type="text" name="bfsqbh" class="form-control" id="bfsqbh_bf"-->
                    <!--placeholder="请输入设备报废申请编号">-->
                    <!--<span class="help-block"></span>-->
                    <!--</div>-->
                    <!--</div>-->
                    <div class="form-group">
                        <label class="col-sm-5 control-label" id="bfrq">报废日期</label>
                        <div class="col-sm-7 input-group date" id="bfrqdiv">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input name="whrq" id="whrq_id_bf" style="margin: 0px auto;" class="form-control"
                                   type="text" readonly="readonly"
                                   placeholder="yyyy-MM-dd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-5 control-label" id="beizlab">备注信息</label>
                        <div class="col-sm-7">
                            <input type="text" name="bfbeiz" class="form-control" id="beiz1"
                                   style="margin: 0px -15px 0px -15px;"
                                   placeholder="请输入备注信息">
                            <span class="help-block"></span>
                        </div>
                    </div>

                    <div class="row">
                        <div class="form-group">
                            <!--                        <label class="font-noraml">多文件上传</label>-->
                            <div class="file-loading">
                                <input id="fileinput-demo-1" name="file" type="file" multiple>
                            </div>
                        </div>
                    </div>

                    <!--<input type="text" th:value="${#dates.format(new java.util.Date(), 'yyyy-MM-dd')}" />-->
                    <!--<a th:text="${#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd HH:mm:ss')}">time</a>-->
                    <hr style="width: 125%;margin-left: -30px;margin-top: -10px">
                </form>
                <div style="float: right;margin-top: -10px">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="bf_save_btn" onclick="baofei()">报废</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--设备报废模态框结束-->

<!--设备升级模态框开始-->
<div class="modal fade" id="sbshenjModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     style="margin: 0px 0px 0px -45px"
     data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h2 class="modal-title" id="sbModalLabel"><strong>设备变更</strong></h2>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div class="wrapper wrapper-content animated fadeInRight">
                        <div class="row" id="sjdiv">
                            <div class="form-group" id="touid">
                                <label class="col-sm-2 control-label toulab">公司名称</label>
                                <div class="col-sm-2 toudiv">
                                    <input type="hidden" class="form-control" id="gsid_sj" name="gsid">
                                    <input type="text" readonly class="form-control" id="gsmc">
                                </div>
                                <label class="col-sm-2 control-label toulab">设备名称</label>
                                <div class="col-sm-2 toudiv">
                                    <input id="sbmc_sj" class="form-control" type="text" readonly="readonly">
                                </div>
                                <label class="col-sm-2 control-label toulab">设备编号</label>
                                <div class="col-sm-2 toudiv">
                                    <input id="sbbh_sj" class="form-control touinput" type="text" readonly="readonly"
                                           name="sbbh">
                                </div>
                            </div>
                            <div class="col-sm-4" id="fldiv1" style="float: left;width: 50%">
                                <div class="ibox float-e-margins" style="margin: 0px -30px 0px 0px">
                                    <div class="ibox-title">
                                        <h5>原设备信息</h5>
                                    </div>
                                    <div class="ibox-content">
                                        <div class="form-group" id="ibox1">
                                            <label class="col-sm-5 control-label sjlab">主&nbsp;&nbsp;&nbsp;&nbsp;板</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="yzbxh_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">C&nbsp;&nbsp;P&nbsp;&nbsp;U</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="ycpuxh_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">内&nbsp;&nbsp;&nbsp;&nbsp;存</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="yncggdx_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">显&nbsp;&nbsp;&nbsp;&nbsp;卡</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="yxkxh_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">硬盘一</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="yypdx1_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">硬盘二</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="yypdx2_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">硬盘三</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="yypdx3_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">备&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control sjinput" id="ybeiz_sj"
                                                       readonly="readonly">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group" style="display: none">
                                            <label class="col-sm-5 control-label">维护日期</label>
                                            <div class="col-sm-7 input-group date">
                                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                                <input name="whrq" id="whrq_sj" class="form-control" type="text"
                                                       readonly="readonly"
                                                       placeholder="yyyy-MM-dd">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <hr>
                            </div>
                            <div class="col-sm-4" id="fldiv2" style="float: right;width: 50%">
                                <div class="ibox float-e-margins" style="margin: 0px -30px 0px 0px">
                                    <div class="ibox-title">
                                        <h5>设备升级信息</h5>
                                    </div>
                                    <div class="ibox-content">
                                        <div class="form-group" id="ibox2">
                                            <label class="col-sm-5 control-label sjlab">主&nbsp;&nbsp;&nbsp;&nbsp;板</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="zbxh" class="form-control zbinput"
                                                       id="xzbxh_sj"
                                                       placeholder="主板型号">
                                                <input type="hidden" name="whlb" class="form-control" id="xwhlb_sj">
                                                <input type="hidden" name="gzyy" class="form-control" id="xgzyy_sj">
                                                <input type="hidden" name="jjfa" class="form-control" id="xjjfa_sj">
                                                <input type="hidden" name="weihr" class="form-control" id="xweihr_sj">
                                                <input type="hidden" name="whjl" class="form-control" id="xwhjl_sj">
                                                <input type="hidden" name="bm" class="form-control" id="xbm_sj">
                                                <input type="hidden" name="shiyr" class="form-control" id="xshiyr_sj">
                                                <input type="hidden" name="ybm" class="form-control" id="xybm_sj">
                                                <input type="hidden" name="yshiyr" class="form-control" id="xyshiyr_sj">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">C&nbsp;&nbsp;P&nbsp;&nbsp;U</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="cpuxh" class="form-control sjinput"
                                                       id="xcpuxh_sj"
                                                       placeholder="CPU型号">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">内&nbsp;&nbsp;&nbsp;&nbsp;存</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="ncggdx" class="form-control sjinput"
                                                       id="xncggdx_sj"
                                                       onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                                       onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                                       placeholder="内存大小">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">显&nbsp;&nbsp;&nbsp;&nbsp;卡</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="xkxh" class="form-control sjinput"
                                                       id="xxkxh_sj">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">硬盘一</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="ypdx" class="form-control sjinput"
                                                       id="xypdx1_sj"
                                                       placeholder="硬盘一信息">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">硬盘二</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="ypdx" class="form-control sjinput"
                                                       id="xypdx2_sj"
                                                       placeholder="硬盘二信息">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">硬盘三</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="ypdx" class="form-control sjinput"
                                                       id="xypdx3_sj"
                                                       placeholder="硬盘三信息">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label sjlab">备&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="sjbeiz" class="form-control sjinput"
                                                       id="xbeiz_sj"
                                                       placeholder="备注信息">
                                                <span class="help-block"></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <hr>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="sj_save_btn" onclick="shengji()">升级</button>
            </div>
        </div>
    </div>
</div>
<!--设备升级模态框结束-->

<!--点击维护后打开的登录的模态框开始-->
<div class="modal fade" id="empAddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     data-backdrop="static"
     data-keyboard="false">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">管理员登录</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div id="error_box"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户名</label>
                        <div class="col-sm-10">
                            <input type="text" name="loginName" class="form-control" id="uname"
                                   placeholder="请输入账户名">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input type="password" name="loginPassword" class="form-control" id="upass"
                                   placeholder="请输入密码">
                            <span class="help-block"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="emp_save_btn" onclick="login()">登录</button>
            </div>
        </div>
    </div>
</div>
<!--点击维护后打开的登录的模态框结束-->

<!--维护模态框开始-->
<div class="sbwhmodal">
    <div class="modal fade" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static"
         data-keyboard="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span>
                    </button>
                    <h3 class="modal-title"><strong>设备维护</strong></h3>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" id="sbwhform">
                        <div class="form-group" style="display: none">
                            <label class="col-sm-2 control-label">设备id号(隐藏)</label>
                            <div class="col-sm-10">
                                <input type="text" name="gsid" class="form-control" id="gsid_update_input_15">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group" style="display: none">
                            <label class="col-sm-2 control-label">设备id号(隐藏)</label>
                            <div class="col-sm-10">
                                <input type="text" name="whrq" class="form-control" id="whrq_update_input_15">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group" style="display: none">
                            <label class="col-sm-2 control-label">设备编号(隐藏)</label>
                            <div class="col-sm-10">
                                <input type="text" name="sbbh" class="form-control" id="sbbh_update_input_15">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label top_lab">故障分类</label>
                            <div class="col-sm-10" id="gzfl_div">
                                <select name="gzfl" class="form-control" id="gzfl_update_input_15">
                                    <option value="0">请选择故障分类</option>
                                </select>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label top_lab">故障原因</label>
                            <div class="col-sm-10" id="gzyy_div">
                                <select name="gzyy" class="form-control" id="gzyy_update_input_15">
                                    <option value="0">请选择故障原因</option>
                                </select>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label top_lab">解决方案</label>
                            <div class="col-sm-7" id="jjfa_div">
                                <select name="jjfa" class="form-control" id="jjfa_update_input_15">
                                    <option value="0">请选择解决方案</option>
                                </select>
                                <span class="help-block"></span>
                            </div>
                            <input type="hidden" name="whjl" id="whjl_input">
                            <input type="hidden" name="whlb" id="whlb_input">
                            <input type="hidden" name="whjlbh" id="whjlbh_input">
                            <div class="col-sm-2" id="add_jjfa_div">
                                <button type="button" class="btn btn-white" id="add_jjfa">添加解决方案</button>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label top_lab">部门名称</label>
                            <div class="col-sm-4" id="selbm_div">
                                <select name="bm" class="form-control" id="selectbm">
                                </select>
                                <!--<input name="bm" id="selectbm" style="background-color: #FFFFFF" class="form-control" list="browsersbybm"><datalist id="browsersbybm"></datalist>-->
                                <input type="hidden" id="bmmc_hidden">
                                <input type="hidden" id="ybmmc" name="ybm">
                            </div>
                            <label class="col-sm-2 control-label top_lab" id="shiyr_lab">使用人</label>
                            <div class="col-sm-3">
                                <input name="shiyr" id="shiyr01" style="background-color: #FFFFFF" class="form-control"
                                       list="browsers">
                                <datalist id="browsers"></datalist>
                                <span class="help-block"></span>
                                <input type="hidden" id="yshiyr" name="yshiyr">
                            </div>
                            <div class="col-sm-1" id="add_yg_div">
                                <button type="button" class="btn btn-white" id="add_yg">人员管理</button>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" id="weihr_lab" style="color: #9b9b9b">维护人：</label>
                            <div class="col-sm-4" id="weihr_div">
                                <input type="text" name="weihr" class="form-control" id="weihr_update_input_15"
                                       style="color: #9b9b9b"
                                       readonly="readonly">
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                <button type="button" class="btn btn-white" id="sbwh_insert_btn" onclick="savesbwh()">
                                    保存
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!--编辑模态框结束-->
<!--<div>-->
<!--<button type="button" class="dydjb">打印登记表</button>-->
<!--</div>-->
<div class="main-content">
    <div id="djbdy">
        <table class="table table-bordered" th:each="sbxxb : ${sbxxb}" th:id="${sbxxb.id}">
            <div class="row">
                <div class="col-sm-12 text-right">
                    <h1 class="font-bold text-center" id="djb"></h1>
                    <small class="font-bold" id="wenh">HWGA-QR-114-2017-01</small>
                </div>
            </div>
            <thead style="background-color: #8DB4E2">
            <tr>
                <th colspan="4"><h3 class="font-bold text-center">设备详情</h3></th>
            </tr>
            </thead>
            <tbody><img class="image" th:style="${sbxxb.bfbs}=='1' ? '' :'display:none'" src="/img/baofei.png"/>
            <tr>
                <th scope="row" class="text-center">设备编号</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.sbbh}" th:id="${sbxxb.sbbh}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">设备名称</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.sbmc}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">品牌型号</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.guige}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="col-sm-1 text-center">购买时间</th>
                <td class="text-center col-sm-4" th:text="${sbxxb.gmrq}">2019-12-31</td>
                <th scope="row" class="col-sm-2 text-center">显示器购买时间</th>
                <td class="text-center col-sm-5" th:text="${#strings.isEmpty(sbxxb.xsqgmrq)}?'/':${sbxxb.xsqgmrq}">/
                </td>
            </tr>
            <tr>
                <th scope="row" class="text-center">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</th>
                <td colspan="3" class="text-center"
                    th:text="${sbxxb.beiz}+'/'+${sbxxb.sjbeiz}+'/'+${sbxxb.bfbeiz}"></td>
            </tr>
            </tbody>
            <thead>
            <tr>
                <th colspan="4"><h3 class="font-bold text-center">配置参数</h3></th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <th scope="row" class="text-center">CPU</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.cpuxh}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">主板</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.zbxh}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">内存</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.ncggdx}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">硬盘</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.ypdx}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">IP地址</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.ipdz}">集成</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">MAC</th>
                <td colspan="3" class="text-center" th:text="${sbxxb.macdz}">Larry the Bird</td>
            </tr>
            <tr>
                <th scope="row" class="text-center">备注</th>
                <!--<td colspan="3" class="text-center" th:text="${sbxxb.beiz}+'/'+${sbxxb.sjbeiz}+'/'+${sbxxb.bfbeiz}">Larry the Bird</td>-->
                <!--<td colspan="3" class="text-center" th:text="${#strings.isEmpty(sbxxb.beiz) and #strings.isEmpty(sbxxb.sjbeiz) and #strings.isEmpty(sbxxb.bfbeiz)}?'':${sbxxb.beiz}+'/'+${sbxxb.sjbeiz}+'/'+${sbxxb.bfbeiz}">Larry the Bird</td>-->
                <td colspan="3" class="text-center"
                    th:text="${sbxxb.beiz}+'/'+${sbxxb.sjbeiz}+'/'+${sbxxb.bfbeiz}"></td>
                <!--<span th:text="${name2} ?: '默认值'"></span>-->
                <!--<button class="btn btn-danger"  th:style="${#strings.contains(sbxxb.sbmc,'服务器')}?'':'display:none'" onclick="sbsj()" id="sbsj">-->
                <!--<i class="fa fa-remove"></i>设备升级-->
            </tr>
            <tr>
                <th scope="row" class="col-sm-2 text-center">部门</th>
                <td class="text-center col-sm-4" th:text="${sbxxb.bm}">2019-12-31</td>
                <th scope="row" class="col-sm-2 text-center">使用人员</th>
                <td class="text-center col-sm-4" th:text="${sbxxb.shiyr}">/</td>
            </tr>
            </tbody>
        </table>
        <div style="margin-top: -21px">
            <table class="table table-bordered">
                <thead style="background-color: #8DB4E2">
                <tr>
                    <th colspan="4"><h3 class="font-bold text-center">维护记录</h3></th>
                </tr>
                </thead>
            </table>
        </div>
        <div style="overflow-y: scroll;max-height: 176px;margin-top: -21px">
            <table class="table table-bordered">
                <tbody>
                <tr th:each="sbwhb : ${sbwhb}">
                    <td colspan="4" class="text-center"
                        th:text="${sbwhb.whjl}">Larry the Bird
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="row" style="margin-top: 20px">
        <div class="btn-group-lg" id="toolbar" role="group" align="center" th:each="sbxxb : ${sbxxb}"
             th:style="${sbxxb.bfbs}=='1' ? 'display:none' :''">
            <button class="btn btn-success" onclick="updatetjmtk()" id="whid">
                <i class="fa fa-pencil"></i>设备维护
            </button>
            <button class="btn btn-danger"
                    th:style="${#strings.contains(sbxxb.sbmc,'脑') or #strings.contains(sbxxb.sbmc,'笔记本') or #strings.contains(sbxxb.sbmc,'务器')}?'':'display:none'"
                    onclick="sbsj()" id="sbsj">
                <i class="fa fa-remove"></i>设备升级
            </button>
            <!--<button class="btn btn-danger"  th:style="${#strings.contains(sbxxb.sbmc,'服务器')}?'':'display:none'" onclick="sbsj()" id="sbsj">-->
            <!--<i class="fa fa-remove"></i>设备升级-->
            <!--</button>-->
            <!--<button class="btn btn-danger"  th:style="${#strings.contains(sbxxb.sbmc,'笔记本')}?'':'display:none'" onclick="sbsj()" id="sbsj">-->
            <!--<i class="fa fa-remove"></i>设备升级-->
            <!--</button>-->
            <button class="btn btn-info" onclick="sbbf()" id="sbbf">
                <i class="fa fa-remove"></i>设备报废
            </button>
            <div id="xxxg_id" class="col-xs-10 col-xs-offset-1" style="margin-top: 5px;">
                <button th:style="${#strings.contains(sbxxb.sbmc,'脑') or #strings.contains(sbxxb.sbmc,'笔记本') or #strings.contains(sbxxb.sbmc,'务器')}?'':'display:none'"
                                                                                    onclick="xxxg()" id="xxxg" type="button" class="btn btn-primary btn-lg btn-block"><i class="fa fa-dashboard"></i>信息修改</button></div></div>
    </div>
    <div style="margin-top: 20px"></div>
</div>
<div th:replace="zdyyj :: myfooter"></div>
<!--点击信息修改打开手机端模态框开始-->
<div class="modal fade" id="xxxgModal" tabindex="-1" role="dialog" aria-hidden="true"
     data-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="xxxgModalLabel">信息修改</h4>
            </div>
            <div class="modal-body" style="margin-bottom: -25px">
                <div class="row">
                    <div class="form-group">
                        <form id="xxxg_form">
                        <table width="100%" style="margin-top: 5px">
                            <tr>
                                <td  width="25%"><label class="col-sm-4">公司编码</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="gsid" id="gsbh_xxxg" class="form-control" type="text" placeholder="请输入公司编码" required="required" readonly>
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">设备名称</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="sbmc" id="sbmc_xxxg" class="form-control" type="text" placeholder="请输入设备名称" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">设备编号</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="sbbh" id="sbbh_xxxg" class="form-control" type="text" placeholder="请输入设备编号" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">品牌类型</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="guige" id="pplx_xxxg" class="form-control" type="text" placeholder="请输入品牌类型" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">生产厂家</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="shccj" id="sccj_xxxg" class="form-control" type="text" placeholder="请输入生产厂家" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">购买日期</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="gmrq" id="gmrq_xxxg" class="form-control" type="text" placeholder="请输入购买日期" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">主板型号</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="zbxh" id="zbxh_xxxg" class="form-control" type="text" placeholder="请输入主板型号" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">CPU型号</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="cpuxh" id="cpuxh_xxxg" class="form-control" type="text" placeholder="请输入CPU型号" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">显  示  器</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="xsqppcc" id="xsq_xxxg" class="form-control" type="text" placeholder="请输入显示器" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">显卡类型</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="xkxh" id="xklx_xxxg" class="form-control" type="text" placeholder="请输入显卡类型" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">内存大小</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="ncggdx" id="ncdx_xxxg" class="form-control" type="text" placeholder="请输入内存大小" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">硬盘信息</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="ypdx" id="ypxx_xxxg" class="form-control" type="text" placeholder="请输入硬盘信息" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">IP 地 址</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="ipdz" id="ipdz_xxxg" class="form-control" type="text" placeholder="请输入IP地址" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">MAC地址</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="macdz" id="macdz_xxxg" class="form-control" type="text" placeholder="请输入MAC地址" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">使用人名</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="shiyr" id="syrm_xxxg" class="form-control" type="text" placeholder="请输入硬盘信息" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">使用部门</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="bm" id="sybm_xxxg" class="form-control" type="text" placeholder="请输入使用部门" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">升级备注</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="sjbeiz" id="shjbz_xxxg" class="form-control" type="text" placeholder="请输入升级备注" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">报废备注</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="bfbeiz" id="bfbz_xxxg" class="form-control" type="text" placeholder="请输入报废备注" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="col-sm-4">财务备注</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="caiwbeiz" id="cwbz_xxxg" class="form-control" type="text" placeholder="请输入财务备注" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;">
                                <td><label class="col-sm-4">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="beiz" id="beizbz_xxxg" class="form-control" type="text" placeholder="请输入备注" required="required">
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 50px;display: none">
                                <td><label class="col-sm-4">使用部门</label></td>
                                <td>
                                    <div class="col-sm-8" style="margin-left: -30px;margin-top: -5px">
                                        <input name="id" id="id_xxxg" class="form-control" type="text" placeholder="请输入使用部门" required="required">
                                    </div>
                                </td>
                            </tr>
                        </table></form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="xxxg_btn" onclick="xxxg_bth()">修改</button>
            </div>
        </div>
    </div>
</div>
<!--点击信息修改打开手机端模态框结束-->
<th:block th:include="include :: footer"/>
<!--<th:block th:include="include :: select2-js" />-->
<th:block th:include="include :: bootstrap-select-js"/>
<script th:src="@{/ruoyi/js/jquery-confirm.min.js}"></script>
<script th:src="@{/ruoyi/js/jquery.form.js}"></script>
<th:block th:include="include :: bootstrap-fileinput-js" />
<script type="text/javascript">
    var username = ""
    var ancestors = ""
    var sessionname = "[[${session.username}]]"
    var gsid = "[[${session.gsid}]]"
    var spid = document.getElementsByTagName("td")[0].firstChild.nodeValue;
    $(document).ready(function () {
        if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
            document.getElementById("xxxg_id").style.display = ""
        }else {
            document.getElementById("xxxg_id").style.display = "none"
        }
        if (sessionname == "") {
            document.getElementById("sbbf").style.display = "none"
            document.getElementById("sbsj").style.display = "none"
            document.getElementById("xxxg_id").style.display = "none"
        }
        if (gsid == "") {
            $.ajax({
                url: "/sbgl/wenhb/getGsid",
                type: 'GET',
                success: function (result) {
                    gsid = result
                }
            })
            return gsid;
        }
        var miaos = "计算机设备登记表";
        var iswenhb = cfxpd("/sbgl/wenhb/getlist", miaos, gsid)
        if (iswenhb != "") {
            document.getElementById('djb').textContent = iswenhb[0].whmc;
            document.getElementById('wenh').innerHTML = iswenhb[0].wenh;
        } else {
            document.getElementById('djb').textContent = "";
            document.getElementById('wenh').innerHTML = "";
        }
    })

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#whrq_id_bf',
                type: 'date'
            });
        });
    });

    function login() {
        var loginName = $("#uname").val();
        var loginPassword = $("#upass").val();
        var spid = document.getElementsByTagName("td")[0].firstChild.nodeValue;
        $.ajax({
            url: "/nc/sysUser/login/" + loginName + "/" + loginPassword,
            type: 'GET',
            success: function (result) {
                username = result[0].userName;
                if (result != null) {
                    $("#empAddModal").modal('hide');
                    $("#myModal5").modal({
                        backdrop: "static"
                    });
                    $.ajax({
                        url: "/sbgl/sbxxb/getsbwh/" + spid + "/" + gsid,
                        type: 'GET',
                        success: function (result) {
                            //console.log(retult);
                            $("#gsid_update_input_15").val(gsid);
                            $("#sbbh_update_input_15").val(result[0].sbbh);
                            $("#emp_update_btn").val(result[0].sbbh);
                            $("#weihr_update_input_15").val(sessionname);
                            $("#selectbm").val(result[0].bmid);
                            $("#shiyr01").val(result[0].shiyr);
                            $.ajax({
                                url: "/sbgl/whflb/getgzyy/" + gsid,
                                type: 'GET',
                                success: function (data) {
                                    $('#gzyy_update_input_15').empty();
                                    var options = "";   //字符串拼接
                                    $("#gzyy_update_input_15").append('<option value="0">请选择故障原因</option>');
                                    for (var i in data) {  //遍历json数组
                                        options += "<option value='" + data[i].gzyy + "'>" + data[i].gzyy + "</option>"
                                        //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                                    }
                                    $('#gzyy_update_input_15').append(options);
                                }
                            })
                        }
                    });
                }
            },
            error: function () {
                $.alert("您好，你输入的用户名和密码不匹配，请核对后重新登录，谢谢您的合作！！！", "温馨提示");
                window.location.href = "/sbgl/sbxxb/sbwh/" + spid;
            }
        })
    }

    function confirm(title, content, ele) {
        $.confirm({
            title: title,
            content: content,
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        $(ele).modal('hide');
                    }
                }
            }
        });
    }

    function sbsj() {
        var spid = document.getElementsByTagName("td")[0].firstChild.nodeValue;
        $.ajax({
            url: "/sbgl/sbxxb/getsbwh/" + spid + "/" + gsid,
            type: 'GET',
            success: function (result) {
                $("#yncggdx_sj").val(result[0].ncggdx);
                $("#xncggdx_sj").val(result[0].ncggdx);
                $("#yzbxh_sj").val(result[0].zbxh);
                $("#xzbxh_sj").val(result[0].zbxh);
                $("#ycpuxh_sj").val(result[0].cpuxh);
                $("#xcpuxh_sj").val(result[0].cpuxh);
                $("#yxkxh_sj").val(result[0].xkxh);
                $("#xxkxh_sj").val(result[0].xkxh);
                var ypdx = result[0].ypdx.split("+")
                $("#yypdx1_sj").val(ypdx[0]);
                $("#yypdx2_sj").val(ypdx[1]);
                $("#yypdx3_sj").val(ypdx[2]);
                $("#xypdx1_sj").val(ypdx[0]);
                $("#xypdx2_sj").val(ypdx[1]);
                $("#xypdx3_sj").val(ypdx[2]);
                $("#gsid_sj").val(result[0].gsid);
                $.ajax({
                    url: "/sbgl/gsxxb/getgsmc/" + gsid,
                    type: "get",
                    async: false,
                    success: function (date) {
                        $("#gsmc").val(date);
                    }
                })
                $("#sbmc_sj").val(result[0].sbmc);
                $("#sbbh_sj").val(result[0].sbbh);
                $("#ybeiz_sj").val(result[0].sjbeiz);
                $("#xbeiz_sj").val(result[0].sjbeiz);
                $("#xwhlb_sj").val("设备升级")
                $("#xweihr_sj").val(sessionname)
                $("#xbm_sj").val(result[0].bm)
                $("#xshiyr_sj").val(result[0].shiyr)
                $("#xybm_sj").val(result[0].bm)
                $("#xyshiyr_sj").val(result[0].shiyr)
                $("#whrq_sj").val(getdate())
                var sbmc = result[0].sbmc
                if (sbmc.indexOf("脑") <= 0 && sbmc.indexOf("务器") <= 0) {
                    $("#xncggdx_sj").attr("readonly", "readonly")
                    $("#xzbxh_sj").attr("readonly", "readonly")
                    $("#xcpuxh_sj").attr("readonly", "readonly")
                    $("#xypdx1_sj").attr("readonly", "readonly")
                    $("#xypdx2_sj").attr("readonly", "readonly")
                    $("#xypdx3_sj").attr("readonly", "readonly")
                    $("#xxkxh_sj").attr("readonly", "readonly")
                }
            }
        })
        document.getElementById('xncggdx_sj').style.color = "#676a6c"
        document.getElementById('xzbxh_sj').style.color = "#676a6c"
        document.getElementById('xcpuxh_sj').style.color = "#676a6c"
        document.getElementById('xypdx1_sj').style.color = "#676a6c"
        document.getElementById('xypdx2_sj').style.color = "#676a6c"
        document.getElementById('xypdx3_sj').style.color = "#676a6c"
        document.getElementById('xbeiz_sj').style.color = "#676a6c"
        document.getElementById('xxkxh_sj').style.color = "#676a6c"
        $('#sbshenjModal').modal({
            backdrop: "static"
        });
    }

    $("#xxkxh_sj").bind("input propertychange", function () {
        document.getElementById("xxkxh_sj").style.color = "red"
    });
    $("#xncggdx_sj").bind("input propertychange", function () {
        document.getElementById("xncggdx_sj").style.color = "red"
    });
    $("#xzbxh_sj").bind("input propertychange", function () {
        document.getElementById("xzbxh_sj").style.color = "red"
    });
    $("#xcpuxh_sj").bind("input propertychange", function () {
        document.getElementById("xcpuxh_sj").style.color = "red"
    });
    $("#xypdx1_sj").bind("input propertychange", function () {
        document.getElementById("xypdx1_sj").style.color = "red"
    });
    $("#xypdx2_sj").bind("input propertychange", function () {
        document.getElementById("xypdx2_sj").style.color = "red"
    });
    $("#xypdx3_sj").bind("input propertychange", function () {
        document.getElementById("xypdx3_sj").style.color = "red"
    });
    $("#xbeiz_sj").bind("input propertychange", function () {
        document.getElementById("xbeiz_sj").style.color = "red"
    });

    function sbbf() {
        var spid = document.getElementsByTagName("td")[0].firstChild.nodeValue;
        $("#sbbfModalLabel").html("设备报废(" + spid + ")")
        $('#sbbaofModal').modal({
            backdrop: "static"
        });
        $.ajax({
            url: "/sbgl/sbxxb/getsbwh/" + spid + "/" + gsid,
            type: 'GET',
            success: function (result) {
                $("#bm_bf").val(result[0].bm)
                $("#ybm_bf").val(result[0].bm)
                $("#shiyr_bf").val(result[0].shiyr);
                $("#weihr_bf").val(sessionname);
                $("#yshiyr_bf").val(result[0].shiyr);
                $("#gsid_bf").val(result[0].gsid);
                $("#sbbh_bf").val(result[0].sbbh);
                $("#gmrq_bf").val(result[0].gmrq);
                $("#whlb_bf").val("设备报废");
                $("#gzyy_bf").val("设备报废");
                $("#jjfa_bf").val("设备报废");
            }
        })
    }

    // 点击编辑按钮弹出模态框。
    function updatetjmtk() {
        if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) { //移动端
            gsid = [[${session.gsid}]]
            sessionname = "[[${session.username}]]"
            if (sessionname == "") {
                $("#loginModal").modal({
                    backdrop: "static"
                });
                getksmc()
                // $.confirm({
                //     title: '请输入账号与密码',
                //     content: '' +
                //             '<div className="wrapper wrapper-content animated fadeIn">'+
                //             '<div className="row">'+
                //                 '<div className="col-sm-12">'+
                //         '<div className="tabs-container">'+
                //             '<ul className="nav nav-tabs">'+
                //                 '<li className="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 选项卡</a>'+
                //                 '</li>'+
                //                 '<li className=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">选项卡</a>'+
                //                 '</li>'+
                //             '</ul>'+
                //             '<div className="tab-content">'+
                //                 '<div id="tab-1" className="tab-pane active">'+
                //                     '<div className="panel-body">'+
                //                        '<strong>HTML5 文档类型</strong>'+
                //                         '<p>Bootstrap 使用到的某些 HTML 元素和 CSS 属性需要将页面设置为 HTML5文档类型。在你项目中的每个页面都要参照下面的格式进行设置。</p>'+
                //                     '</div>'+
                //                 '</div>'+
                //                 '<div id="tab-2" className="tab-pane">'+
                //                     '<div className="panel-body">'+
                //                         '<strong>移动设备优先</strong>'+
                //                         '<p>在 Bootstrap 2 中，我们对框架中的某些关键部分增加了对移动设备友好的样式。而在 Bootstrap 3中，我们重写了整个框架，使其一开始就是对移动设备友好的。这次不是简单的增加一些可选的针对移动设备的样式，而是直接融合进了框架的内核中。也就是说，Bootstrap是移动设备优先的。针对移动设备的样式融合进了框架的每个角落，而不是增加一个额外的文件。</p>'+
                //                     '</div>'+
                //                 '</div>'+
                //             '</div>'+
                //         '</div>'+
                //         '</div>'+
                //         '</div>'+
                //         '</div>'+
                //         '<form action="" class="formName">' +
                //         '<div class="row"><div class="form-group">' +
                //         '<label style="float: left;margin-left: 20px;margin-top: 5px">公司名称：</label>' +
                //         '<select class="gsid form-control" name="gsid" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"></select></div></div>' +
                //         '<div class="row"><div class="form-group">' +
                //         '<label style="float: left;margin-left: 20px;margin-top: 5px">用&nbsp&nbsp户&nbsp&nbsp名：</label>' +
                //         '<input type="text" placeholder="请输入用户名" class="username form-control" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"/></div></div> ' +
                //         '<div class="row"><div class="form-group">' +
                //         '<label style="float: left;margin-left: 20px;margin-top: 5px">密&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp码：</label>' +
                //         '<input type="password" placeholder="请输入密码" class="password form-control" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"/></div></div>' +
                //         '<div class="row"><div class="form-group">' +
                //         '<label style="float: left;margin-left: 20px;margin-top: 5px">快登编号：</label>' +
                //         '<input type="text" placeholder="请输入用户名" class="ksdlbh form-control" style="width: 60%;float: right;margin-top: 0px;margin-right: 20px"/></div></div> ' +
                //         '</form>',
                //     buttons: {
                //         ksdlbh: {
                //             text: '快登',
                //             btnClass: 'btn-green',
                //             action: function () {
                //                 var ksdlbh = this.$content.find('.ksdlbh').val();
                //                 var self = this;
                //                 self.setContent('Checking callback flow');
                //                 return $.ajax({
                //                     url: '/sbgl/ygxxb/ksdlbh/' + ksdlbh,
                //                     dataType: 'json',
                //                     method: 'get'
                //                 }).done(function (response) {
                //                     var cxgsid = response;
                //                     var dlgsid=response[0].gsid;
                //                     // window.location.href = window.location.href;
                //                     if(dlgsid==cxgsid){
                //                         window.location.href = window.location.href;
                //                     }else {
                //                         confirm("温馨提示","手机端你无权限访问该公司的信息")
                //                         window.location.href="/sbgl/"+spid;
                //                         // window.location.href = window.location.href;
                //                     }
                //                 }).fail(function () {
                //                     // alert("您好，您是怎么操作的，能走到这里，这是个奇迹")
                //                     // alert("您好，你输入的用户名和密码不匹配，请核对后重新登录，谢谢您的合作！！！");
                //                     // window.location.href = window.location.href;
                //                 });
                //
                //             },
                //         },
                //         login: {
                //             text: '登录',
                //             btnClass: 'btn-blue',
                //             action: function () {
                //                 var gsid = this.$content.find('.gsid').val();
                //                 var loginName = this.$content.find('.username').val();
                //                 var loginPassword = this.$content.find('.password').val();
                //                 var ksdlbh = this.$content.find('.ksdlbh').val();
                //                 var self = this;
                //                 self.setContent('Checking callback flow');
                //                 return $.ajax({
                //                     url: '/sbgl/ygxxb/login/' + gsid + '/' + loginName + '/' + loginPassword,
                //                     dataType: 'json',
                //                     method: 'get'
                //                 }).done(function (response) {
                //                     var dlgsid=response[0].gsid;
                //                     return $.ajax({
                //                         url: '/sbgl/sbxxb/getgsid/' + spid,
                //                         dataType: 'json',
                //                         method: 'get'
                //                     }).done(function (response) {
                //                         var cxgsid = response;
                //                         // window.location.href = window.location.href;
                //                         if(dlgsid==cxgsid){
                //                             window.location.href = window.location.href;
                //                         }else {
                //                             confirm("温馨提示","手机端你无权限访问该公司的信息")
                //                             window.location.href="/sbgl/"+spid;
                //                             // window.location.href = window.location.href;
                //                         }
                //                     }).fail(function () {
                //                         // alert("您好，您是怎么操作的，能走到这里，这是个奇迹")
                //                         // alert("您好，你输入的用户名和密码不匹配，请核对后重新登录，谢谢您的合作！！！");
                //                         // window.location.href = window.location.href;
                //                     });
                //                 }).fail(function () {
                //                     confirm("温馨提示","您好，你输入的用户名和密码不匹配，请核对后重新登录，谢谢您的合作！！！")
                //                     window.location.href = window.location.href;
                //                     // }).always(function(){
                //                     //     self.setContentAppend('<div>Always!</div>');
                //                 });
                //             }
                //         },
                //         cancel: {
                //             text: '取消',
                //             btnClass: 'btn-red',
                //             action: function () {
                //                 //close
                //                 // $('#sbAddModal').modal('show');
                //             },
                //         },
                //     },
                //     onContentReady: function () {
                //         return $.ajax({
                //             url: '/sbgl/gsxxb/getgsxxb/',
                //             dataType: 'json',
                //             method: 'get',
                //         }).done(function (data) {
                //             $('.gsid').empty();
                //             var options = "";   //字符串拼接
                //             $('.gsid').append('<option value="">请选择公司名称</option>');
                //             for (var i in data) {  //遍历json数组
                //                 options += "<option value='" + data[i].gsid + "'>" + data[i].gs + "</option>"
                //                 //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                //             }
                //             $('.gsid').append(options);
                //         })
                //     },
                // });
            } else {
                $.ajax({
                    url: "/sbgl/sbxxb/weihu/" + spid,
                    type: 'GET',
                    async: false,
                    success: function (data) {
                        window.location.href = "/weihu"
                    },
                })
            }
        } else {
            if (sessionname == "") {
                $.confirm({
                    title: '请输入账号与密码',
                    content: '' +
                        '<form action="" class="formName">' +
                        '<div class="form-group">' +
                        '<select class="gsid form-control" name="gsid"></select>' +
                        '<input type="text" placeholder="请输入用户名" class="username form-control"/>' +
                        '<input type="password" placeholder="请输入密码" class="password form-control"/>' +
                        '</div>' +
                        '</form>',
                    buttons: {
                        login: {
                            text: '登录',
                            btnClass: 'btn-blue',
                            action: function () {
                                var gsid = this.$content.find('.gsid').val();
                                var loginName = this.$content.find('.username').val();
                                var loginPassword = this.$content.find('.password').val();
                                // $.ajax({
                                //     url: "/nc/sysUser/login/" + loginName + "/" + loginPassword,
                                //     type: 'GET',
                                //     success: function (result) {
                                //
                                //     }
                                // })
                                var self = this;
                                self.setContent('Checking callback flow');
                                return $.ajax({
                                    url: '/sbgl/ygxxb/login/' + gsid + '/' + loginName + '/' + loginPassword,
                                    dataType: 'json',
                                    method: 'get'
                                }).done(function (response) {
                                    var dlgsid = response[0].gsid;
                                    return $.ajax({
                                        url: '/sbgl/sbxxb/getgsid/' + spid,
                                        dataType: 'json',
                                        method: 'get'
                                    }).done(function (response) {
                                        var cxgsid = response;
                                        // window.location.href = window.location.href;
                                        if (dlgsid == cxgsid) {
                                            window.location.href = window.location.href;
                                        } else {
                                            confirm("温馨提示", "电脑端你无权限访问该公司的信息")
                                            window.location.href = "/sbgl/" + spid;
                                            // window.location.href = window.location.href;
                                        }
                                    }).fail(function () {
                                        // alert("您好，您是怎么操作的，能走到这里，这是个奇迹")
                                        // alert("您好，你输入的用户名和密码不匹配，请核对后重新登录，谢谢您的合作！！！");
                                        // window.location.href = window.location.href;
                                    });
                                }).fail(function () {
                                    confirm("温馨提示", "您好，你输入的用户名和密码不匹配，请核对后重新登录，谢谢您的合作！！！")
                                    window.location.href = window.location.href;
                                    // }).always(function(){
                                    //     self.setContentAppend('<div>Always!</div>');
                                });
                            }
                        },
                        cancel: {
                            text: '取消',
                            btnClass: 'btn-red',
                            action: function () {
                                //close
                                // $('#sbAddModal').modal('show');
                            },
                        },
                    },
                    onContentReady: function () {
                        return $.ajax({
                            url: '/sbgl/gsxxb/getgsxxb/',
                            dataType: 'json',
                            method: 'get',
                        }).done(function (data) {
                            $('.gsid').empty();
                            var options = "";   //字符串拼接
                            $('.gsid').append('<option value="">请选择公司名称</option>');
                            for (var i in data) {  //遍历json数组
                                options += "<option value='" + data[i].gsid + "'>" + data[i].gs + "</option>"
                                //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                            }
                            $('.gsid').append(options);
                        })
                    }
                });
            } else {
                show()
            }
        }
    }

    function show() {
        sessionname = "[[${session.username}]]"
        $("#myModal5").modal({
            backdrop: "static"
        });
        $.ajax({
            url: "/sbgl/sbxxb/getsbwh/" + spid + "/" + gsid,
            type: 'GET',
            async: false,
            success: function (result) {
                //console.log(retult);
                getDepts("#selectbm");
                $("#gsid_update_input_15").val(gsid);
                $("#sbbh_update_input_15").val(result[0].sbbh);
                $("#emp_update_btn").val(result[0].sbbh);
                $("#weihr_update_input_15").val(sessionname);
                $("#selectbm").val(result[0].bm);
                // $("#selectbm").val(result[0].bm)
                // alert($("#selectbm").val())
                $("#bmmc_hidden").val(result[0].bm);
                $("#ybmmc").val(getbmmcsjk(result[0].bm))
                $("#yshiyr").val(getshiyr(spid))
                $("#shiyr01").val(result[0].shiyr);
                $("#shiyr01").attr("readonly", "readonly")
                $("#browsers").val(result[0].shiyr);
                $('#gzfl_update_input_15').val(0)
                $('#gzyy_update_input_15').val(0)
                $('#jjfa_update_input_15').val(0)
                $('#whrq_update_input_15').val(getdate)
                $.ajax({
                    url: "/sbgl/whflb/getgzfl/" + gsid,
                    type: 'GET',
                    success: function (data) {
                        $('#gzfl_update_input_15').empty();
                        var options = "";   //字符串拼接
                        $("#gzfl_update_input_15").append('<option value="0">请选择故障分类</option>');
                        for (var i in data) {  //遍历json数组
                            options += "<option value='" + data[i].gzfl + "'>" + data[i].gzfl + "</option>"
                            //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                        }
                        $('#gzfl_update_input_15').append(options);
                    }
                })
            }
        });
    }

    // function updatetjmtk() {
    //     sessionname="[[${session.username}]]"
    //     if (sessionname == "") {
    //         $("#empAddModal").modal({
    //             backdrop: "static"
    //         });
    //     } else {
    //         $("#myModal5").modal('show');
    //         // $("#myModal5").modal({
    //         //     backdrop: "static"
    //         // });
    //         // $("#myModal5").modal('show');
    //         // window.location.href = window.location.href;
    //         $.ajax({
    //             url: "/sbgl/sbxxb/getsbwh/" + spid,
    //             type: 'GET',
    //             success: function (result) {
    //                 //console.log(retult);
    //                 $("#gsid_update_input_15").val(result[0].id);
    //                 $("#sbbh_update_input_15").val(result[0].sbbh);
    //                 $("#emp_update_btn").val(result[0].sbbh);
    //                 $("#weihr_update_input_15").val(username);
    //                 $("#selectbm").val(result[0].bmid);
    //                 $("#shiyr01").val(result[0].shiyr);
    //                 // window.location.href = window.location.href;
    //                 $.ajax({
    //                     url: "/sbgl/whflb/getname/",
    //                     type: 'GET',
    //                     success: function (data) {
    //                         $('#gzyy_update_input_15').empty();
    //                         var options = "";   //字符串拼接
    //                         $("#gzyy_update_input_15").append('<option value="">请选择故障原因</option>');
    //                         for (var i in data) {  //遍历json数组
    //                             options += "<option value='" + data[i].id + "'>" + data[i].name + "</option>"
    //                             //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
    //                         }
    //                         $('#gzyy_update_input_15').append(options);
    //                     }
    //                 })
    //             }
    //         });
    //     }
    // };

    // $("#whid").click(function () {
    //     getDepts("#myModal5 select");
    // });

    // $("#selectbm").mouseover(function () {
    //     $("#selectbm").removeAttr("readonly")
    // })

    function getDepts(ele) {
        // $('#selectbm').val("");
        // $('#browsersbybm').empty();
        $.ajax({
            url: "/sbgl/ygxxb/getbm/" + gsid,
            type: 'get',
            async: false,
            success: function (data) {
                $(ele).empty();
                var options = "";   //字符串拼接
                $(ele).append('<option value="">请选择部门</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].bm + "'>" + data[i].bm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $(ele).append(options);
            },
        });
    };

    $('#gzfl_update_input_15').change(function () {
        var sbwhid = $("#gzfl_update_input_15 option:selected").val();
        $.ajax({
            url: "/sbgl/whflb/getgzyyforid/" + gsid + "/" + sbwhid,
            type: 'GET',
            async: false,
            success: function (data) {
                $('#gzyy_update_input_15').empty();
                var options = "";   //字符串拼接
                $("#gzyy_update_input_15").append('<option value="0">请选择故障原因</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].gzyy + "'>" + data[i].gzyy + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#gzyy_update_input_15').append(options);
            }

        })
    })

    $('#gzyy_update_input_15').change(function () {
        var sbwhid = $("#gzyy_update_input_15 option:selected").val();
        $.ajax({
            url: "/sbgl/whflb/getjjfa/" + sbwhid + "/" + gsid,
            type: 'GET',
            async: false,
            success: function (data) {
                $('#jjfa_update_input_15').empty();
                var options = "";   //字符串拼接
                $("#jjfa_update_input_15").append('<option value="0">请选择解决方案</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].jjfa + "'>" + data[i].jjfa + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#jjfa_update_input_15').append(options);
            }

        })
    })

    $('#selectbm').change(function () {
        // getDepts("#myModal5 select")
        var bmid = $("#selectbm option:selected").val();
        $('#shiyr01').val("");
        $('#browsers').empty();
        $("#shiyr01").removeAttr("readonly")
        $.ajax({
            url: "/sbgl/ygxxb/getygxx/" + bmid + "/" + gsid,
            type: 'get',
            success: function (data) {
                $('#shiyr01').empty();
                var options = "";   //字符串拼接
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].shiyr + "'>" + data[i].zjm + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#browsers').append(options);
            },
        });
    });

    $("#gzfl").change(function () {
        var gzfl = $('#gzfl').val();
        $.ajax({
            url: "/sbgl/whflb/getgzyybyfl/" + gsid + "/" + gzfl,
            type: 'GET',
            async: false,
            success: function (data) {
                $('#gzyy_fl').empty();
                $('#browsersforgzyy').empty();
                var options = "";   //字符串拼接
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i] + "'>" + data[i] + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#browsersforgzyy').append(options);
            },
        })
    })

    // 获取当前日期
    function getdate() {
        var d = new Date();
        var y = d.getFullYear();
        var m = d.getMonth() + 1;
        var d = d.getDate();
        if (m < 10) m = "0" + m;
        if (d < 10) d = "0" + d;
        return y + "-" + m + "-" + d
    }

    $("#jjfa_update_input_15").change(function () {
        var gzyy = $("#gzyy_update_input_15 option:selected").text();
        var jjfa = $("#jjfa_update_input_15 option:selected").text();
        var index = gzyy.lastIndexOf("\/");
        gzyy = gzyy.substring(index + 1, gzyy.length);
        $("#whjl_input").val("该设备" + getdate() + "由于" + gzyy + "进行设备维护，维护方法为" + jjfa)
    })

    //我之前做的保存维护记录开始
    function savesbwh() {
        var sbbh01 = document.getElementsByTagName("td")[0].firstChild.nodeValue;
        var bmid = $("#selectbm option:selected").val();//新的部门id
        var bmmc = $("#selectbm option:selected").text().replace(/\s+/g, "");//新的部门名称
        var shiyr = $("#shiyr01").val();//新的设备使用人
        var bmmc_hidden = $("#bmmc_hidden").val();//原部门id（隐藏的）
        var shiyr_sjk = getshiyr(sbbh01)
        var bmid_sjk = getbmid(sbbh01);
        var bmmc_sjk = getbmmcsjk(bmmc_hidden);
        var gzyy = $("#gzyy_update_input_15 option:selected").val()
        var jjfa = $("#jjfa_update_input_15 option:selected").val()
        var gzyyT = $("#gzyy_update_input_15 option:selected").text()
        var jjfaT = $("#jjfa_update_input_15 option:selected").text()
        var bmidbyshiyr = "";
        if (shiyr === "" && bmid != bmid_sjk && gzyy == "0") {
            // alert("部门、使用人未改变,故障原因改变了，这里需要提醒请选择解决方案")
            $.alert("使用人不能为空", "温馨提示")
            return false
            // var bmidbyshiyr = getdeptbyshiyr(shiyr)
        } else if (shiyr === "" && bmid === bmid_sjk && gzyy == "0") {
            $.alert("使用人不能为空，整个页面你没有进行操作，不能点击保存", "温馨提示")
            return false
        } else if (shiyr === "" && bmid != bmid_sjk && gzyy != "0" && jjfa == "0") {
            $.alert("使用人不能为空，解决方案不能为空", "温馨提示")
            return false
        } else if (shiyr === "" && bmid != bmid_sjk && gzyy != "0" && jjfa != "") {
            $.alert("使用人不能为空", "温馨提示")
            return false
        } else {
            //部门和使用人相同
            if (shiyr == shiyr_sjk && bmid == bmid_sjk && gzyy == "0") {
                // alert("部门、使用人、故障原因、解决方案都未改变，这里不需要插入任何数据")
                $.alert("你未进行任何操作，不必添加任何的维护记录，你最起码要修改点数据吧！！！", "温馨提示")
            }

            if (shiyr == shiyr_sjk && bmid == bmid_sjk && gzyy != "0" && jjfa == "0") {
                // alert("部门、使用人未改变,故障原因改变了，这里需要提醒请选择解决方案")
                $.alert("请选择解决方案", "温馨提示")
            }

            if (shiyr == shiyr_sjk && bmid == bmid_sjk && gzyy != "0" && jjfa != "0") {
                // alert("部门、使用人未改变,故障原因、解决方案改变，这里需要插入一条故障原因与解决方案的维护记录")
                $("#whlb_input").val("系统维护")
                insertsbwhb()
            }

            //部门使用人都维护了
            if (shiyr != shiyr_sjk && bmid != bmid_sjk && gzyy == "0") {
                // alert("部门和使用人修改了，故障原因与解决方案未选择，这里插入一条部门与使用人维护的一条记录")
                bmidbyshiyr = getdeptbyshiyr(shiyr)
                if (bmidbyshiyr != bmid) {
                    confirm("温馨提示", "此部门查无此人，请核对或点击人员管理")
                } else {
                    $("#whjl_input").val("该设备" + getdate() + "的使用部门由" + bmmc_sjk + "-" + shiyr_sjk + "维护成" + bmmc + "-" + shiyr)
                    $("#whlb_input").val("系统维护")
                    updatesbxxb(spid);
                    insertsbwhb()
                }
            }

            if (shiyr != shiyr_sjk && bmid != bmid_sjk && gzyy != "0" && jjfa == "0") {
                // alert("部门和使用人修改了，故障原因选择了，提示请选择解决方案")
                $.alert("请选择解决方案", "温馨提示");
            }

            if (shiyr != shiyr_sjk && bmid != bmid_sjk && gzyy != "0" && jjfa != "0") {
                // alert("部门、使用人、故障原因、解决方案都修改了，这里需要插入2条记录，一条维护部门使用人，一条维护故障原因解决方案")
                bmidbyshiyr = getdeptbyshiyr(shiyr)
                if (bmidbyshiyr != bmid) {
                    $.alert("此部门查无此人，请核对或点击人员管理", "温馨提示")
                } else {
                    $("#whjl_input").val("该设备" + getdate() + "的使用部门由" + bmmc_sjk + "-" + shiyr_sjk + "维护成" + bmmc + "-" + shiyr)
                    $("#whlb_input").val("系统维护")
                    updatesbxxb(spid);
                    insertsbwhbnotgb()
                    $("#whjl_input").val("该设备" + getdate() + "由于[" + gzyyT + "]进行设备维护，维护方法为[" + jjfaT + "]")
                    insertsbwhb()
                }
            }

            if (shiyr != shiyr_sjk && bmid == bmid_sjk && gzyy != "0" && jjfa != "0") {
                // alert("部门、使用人、故障原因、解决方案都修改了，这里需要插入2条记录，一条维护部门使用人，一条维护故障原因解决方案")
                bmidbyshiyr = getdeptbyshiyr(shiyr)
                if (bmidbyshiyr != bmid) {
                    $.alert("此部门查无此人，请核对或点击人员管理", "温馨提示")
                } else {
                    $("#whjl_input").val("该设备" + getdate() + "的使用部门由" + bmmc_sjk + "-" + shiyr_sjk + "维护成" + bmmc + "-" + shiyr)
                    $("#whlb_input").val("系统维护")
                    updatesbxxb(spid);
                    insertsbwhbnotgb()
                    $("#whjl_input").val("该设备" + getdate() + "由于[" + gzyyT + "]进行设备维护，维护方法为[" + jjfaT + "]")
                    insertsbwhb()
                }
            }

            if (shiyr != shiyr_sjk && bmid == bmid_sjk && gzyy == "0") {
                // alert("部门、使用人、故障原因、解决方案都修改了，这里需要插入2条记录，一条维护部门使用人，一条维护故障原因解决方案")
                bmidbyshiyr = getdeptbyshiyr(shiyr)
                if (bmidbyshiyr != bmid) {
                    $.alert("此部门查无此人，请核对或点击人员管理", "温馨提示")
                } else {
                    $("#whjl_input").val("该设备" + getdate() + "的使用部门由" + bmmc_sjk + "-" + shiyr_sjk + "维护成" + bmmc + "-" + shiyr)
                    updatesbxxb(spid);
                    $("#whlb_input").val("系统维护")
                    insertsbwhb()
                }
            }
        }
    }

    //我之前做的保存维护记录结束

    //通过使用人查询出部门的ID号
    function getdeptbyshiyr(shiyr) {
        var bmid = ""
        $.ajax({
            url: "/sbgl/ygxxb/getbmidbyshiyr/" + shiyr,
            type: 'GET',
            async: false,
            success: function (result) {
                bmid = result
            }
        });
        return bmid;
    }

    function sbwhjm() {
        $.confirm({
            title: '故障原因与解决方案维护',
            content: '' +
                '<form action="" class="sbwhjmform">' +
                '<div class="form-group">' +
                '<label>请先输入硬盘大小后，点击下拉框选择硬盘单位</label>' +
                '<select class="gzyy form-control" name="gzyy" id="gzyy_sbwhjm"></select>' +
                '<select class="jjfa form-control" name="jjfa" id="jjfa_sbwhjm"></select>' +
                '<input type="hidden" placeholder="请输入部门ID号" class="form-control" name="bmid" id="bmid_sbwhjm"/>' +
                '<input type="hidden" placeholder="请输入设备ID号" class="form-control" name="sbid" id="sbid_sbwhjm"/>' +
                '<input type="hidden" placeholder="请输入设备编号" class="form-control" name="sbbh" id="sbbh_sbwhjm"/>' +
                '<label style="width: 60px">维护人：</label>' +
                '<input type="text" readonly="readonly" name="weihr" id="weihr_sbwhjm" style="width: 80px"/>' +
                '<input type="hidden" placeholder="请输入使用人" class="form-control" name="shiyr" id="shiyr_sbwhjm"/>' +
                '<input type="hidden" placeholder="请输入维护记录" class="form-control" name="whjl" id="whjl_sbwhjm"/>' +
                '<input type="hidden" placeholder="请输入原部门名称" class="form-control" name="ybmmc" id="ybmmc_sbwhjm"/>' +
                '<input type="hidden" placeholder="请输入原设备使用人" class="form-control" name="yshiyr" id="yshiyr_sbwhjm"/>' +
                '</div>' +
                '</form>',
            buttons: {
                formSubmit: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        var gzyy = this.$content.find('.gzyy').val();
                        var jjfa = this.$content.find('.jjfa').val();
                        if (!gzyy) {
                            return false;
                        }
                        if (!jjfa) {
                            return false;
                        }
                        if (gzyy != "" && jjfa != "") {
                            return false;
                        }
                        // return $.ajax({
                        //     url: '/nc/sbwhb/insertsbwh',
                        //     dataType: 'json',
                        //     method: 'POST',
                        //     data: $(".formName").serialize(),
                        // }).done(function (data) {
                        //     $.ajax("添加成功！！！");
                        //     window.location.href = window.location.href;
                        // })
                    }
                },
                cancel: function () {
                    //close
                },
            },
            onOpen: function () {
                return $.ajax({
                    url: '/sbgl/whflb/getgzyy/' + gsid,
                    dataType: 'json',
                    method: 'get'
                }).done(function (data) {
                    $('.gzyy').empty();
                    var options = "";   //字符串拼接
                    $('.gzyy').append('<option value="">请选择故障原因</option>');
                    for (var i in data) {  //遍历json数组
                        options += "<option value='" + data[i].gzyy + "'>" + data[i].gzyy + "</option>"
                        //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                    }
                    $('.gzyy').append(options);
                    $('.gzyy').change(function () {
                        var sbwhid = $('.gzyy').val();
                        return $.ajax({
                            url: '/sbgl/whflb/getgzyy/' + sbwhid,
                            dataType: 'json',
                            method: 'get'
                        }).done(function (data) {
                            $('.jjfa').empty();
                            var options = "";   //字符串拼接
                            $('.jjfa').append('<option value="">请选择故障原因</option>');
                            for (var i in data) {
                                options += "<option value='" + data[i].gzyy + "'>" + data[i].gzyy + "</option>"
                            }
                            $('.jjfa').append(options);
                        })
                    })
                    $('#jjfa_sbwhjm').change(function () {
                        return $.ajax({
                            url: "/sbgl/sbxxb/getsbwh/" + spid + "/" + gsid,
                            dataType: 'json',
                            method: 'GET'
                        }).done(function (data) {
                            $('#bmid_sbwhjm').val(data[0].bmid)
                            $('#sbid_sbwhjm').val(data[0].id)
                            $('#sbbh_sbwhjm').val(data[0].sbbh)
                            $('#weihr_sbwhjm').val(sessionname)
                            $('#shiyr_sbwhjm').val(data[0].shiyr)
                            $('#ybmmc_sbwhjm').val(getbmmcsjk(data[0].bm))
                            $('#yshiyr_sbwhjm').val(getshiyr(spid))
                            var gzyy = $("#gzyy_sbwhjm option:selected").text();
                            var jjfa = $("#jjfa_sbwhjm option:selected").text();
                            var index = gzyy.lastIndexOf("\/");
                            gzyy = gzyy.substring(index + 1, gzyy.length);
                            $("#whjl_sbwhjm").val("该设备" + getdate() + "由于[" + gzyy + "]进行设备维护，维护方法为[" + jjfa + "]")
                        })
                    })
                })
            }
        });
    }

    function rywhjm() {
        $.confirm({
            title: '部门与人员维护',
            content: '' +
                '<form action="" class="rywhjmform">' +
                '<div class="form-group">' +
                '<label>请先选择部门名称，点击下拉框选择设备使用人</label>' +
                '<select class="bmmc form-control" name="bmid" id="bmmc_rywhjm"></select>' +
                '<input name="shiyr" id="shiyr_rywhjm" class="shiyr form-control" list="browsers"><datalist id="browsers"></datalist>' +
                '<input type="hidden" placeholder="请输入部门ID号" class="form-control" name="bmid" id="bmid_rywhjm"/>' +
                '<input type="hidden" placeholder="请输入设备ID号" class="form-control" name="sbid" id="sbid_rywhjm"/>' +
                '<input type="hidden" placeholder="请输入设备编号" class="form-control" name="sbbh" id="sbbh_rywhjm"/>' +
                '<label style="width: 60px">维护人：</label>' +
                '<input type="text" readonly="readonly" name="weihr" id="weihr_rywhjm" style="width: 80px"/>' +
                '<input type="hidden" placeholder="请输入使用人" class="form-control" name="shiyr" id="shiyr_rywhjm"/>' +
                '<input type="hidden" placeholder="请输入维护记录" class="form-control" name="whjl" id="whjl_rywhjm"/>' +
                '<input type="hidden" placeholder="请输入原部门名称" class="form-control" name="ybmmc" id="ybmmc_rywhjm"/>' +
                '<input type="hidden" placeholder="请输入原设备使用人" class="form-control" name="yshiyr" id="yshiyr_rywhjm"/>' +
                '</div>' +
                '</form>',
            buttons: {
                formSubmit: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        var bmmc = this.$content.find('.bmmc').val();
                        var shiyr = this.$content.find('.shiyr').val();
                        var ybmid = getbmid(spid)
                        var yshiyr = getshiyr(spid)
                        if (bmmc != ybmid || shiyr != yshiyr) {
                            return false;
                        }
                        if (bmmc == ybmid || shiyr == yshiyr)
                            return false;
                        // return $.ajax({
                        //     url: '/nc/sbwhb/insertsbwh',
                        //     dataType: 'json',
                        //     method: 'POST',
                        //     data: $(".rywhjmform").serialize(),
                        // }).done(function (data) {
                        //     $.ajax("添加成功！！！");
                        //     window.location.href = window.location.href;
                        // })
                    }
                },
                cancel: function () {
                    //close
                },
            },
            onOpen: function () {
                return $.ajax({
                    url: '/sbgl/ygxxb/getbm/' + gsid,
                    dataType: 'json',
                    method: 'get'
                }).done(function (data) {
                    $('.bmmc').empty();
                    var options = "";   //字符串拼接
                    $('.bmmc').append('<option value="">请选择部门</option>');
                    for (var i in data) {  //遍历json数组
                        options += "<option value='" + data[i].bm + "'>" + data[i].bm + "</option>"
                        //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                    }
                    $('.bmmc').append(options);
                    $('.bmmc').change(function () {
                        var bmid = $('.bmmc').val();
                        return $.ajax({
                            url: '/sbgl/ygxxb/getygxx/' + bmid,
                            dataType: 'json',
                            method: 'get'
                        }).done(function (data) {
                            $('#shiyr_rywhjm').empty();
                            $("#browsers").empty();
                            var options = "";   //字符串拼接
                            for (var i in data) {  //遍历json数组
                                options += "<option value='" + data[i].xingm + "'>" + data[i].zjm + "</option>"
                                //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                            }
                            $('#browsers').append(options);
                        })
                    })

                    $('.shiyr').change(function () {

                    })
                })
            }
        });
    }

    function insertwhjl() {
        $.confirm({
            title: '请选择!',
            content: '维护故障原因与解决方案请点击维护设备，设备使用部门与使用人改变请点击维护人员，如果都需要维护请点击全部',
            buttons: {
                sbwh: {
                    text: '设备维护',
                    btnClass: 'btn-blue',
                    keys: ['enter', 'shift'],
                    action: function () {
                        sbwhjm();
                    }
                },
                rywh: {
                    text: '人员维护',
                    btnClass: 'btn-blue',
                    keys: ['enter', 'shift'],
                    action: function () {
                        rywhjm()
                    }
                }
            }
        });
    }

    //通过设备编号获取原部门id
    function getbmid(sbbh) {
        var bmid = 0
        $.ajax({
            url: "/sbgl/sbxxb/getbmid/" + sbbh,
            type: 'GET',
            async: false,
            success: function (result) {
                bmid = result
            }
        });
        return bmid
    }

    function xinncdx(sbbh) {
        var xinncdx = ""
        $.ajax({
            url: "/sbgl/sbxxb/getsbwh/" + sbbh + "/" + gsid,
            type: 'GET',
            async: false,
            success: function (result) {
                xinncdx = result[0].ncggdx
            }
        })
        return xinncdx;
    }

    //通过部门id获取部门名称
    function getbmmcsjk(bmid) {
        var bmmc = ""
        $.ajax({
            url: "/sbgl/ygxxb/getbmmc/" + bmid,
            type: 'GET',
            async: false,
            success: function (result) {
                if (result != null) {
                    bmmc = result.replace(/\s+/g, "");
                    // result.replace(/\s+/g,"");替换所有空格
                    // result.replace(/^\s+|\s+$/g,"");替换前后空格
                }
            }
        });
        return bmmc;
    }

    //通过设备编号获取原使用人
    function getshiyr(sbbh) {
        var shiyr = ""
        $.ajax({
            url: "/sbgl/sbxxb/getshiyr/" + sbbh + "/" + gsid,
            type: 'GET',
            async: false,
            success: function (result) {
                if (result != null) {
                    shiyr = result;
                }
            }
        })
        return shiyr
    }

    //通过设备编号获取原使用人
    function getygid(xingm) {
        var ygid = ""
        $.ajax({
            url: "/nc/ygxxb/getygid/" + xingm,
            type: 'GET',
            async: false,
            success: function (result) {
                if (result != null) {
                    ygid = result;
                }
            }
        })
        return ygid
    }


    function genxsbxxb(sbbh) {
        $.ajax({
            url: "/sbgl/sbxxb/updatesbxxb/" + sbbh,
            type: "put",
            async: false,
            data: $("#sbshenjModal form").serialize(),
            success: function (data) {
                $.alert("设备表更新成功", "温馨提示")
            }
        })
    }


    // 通过设备编号更新设备信息表
    function updatesbxxb(sbbh) {
        $.ajax({
            url: "/sbgl/sbxxb/updatesbxxbbywh/" + sbbh,
            type: "put",
            async: false,
            data: $("#myModal5 form").serialize(),
            success: function (data) {
                $.alert("设备表更新成功", "温馨提示")
            }
        })
    }

    //通过设备编号更新设备信息表(不同form)
    function updatesbxxbbywh(sbbh) {
        $.ajax({
            url: "/sbgl/sbxxb/updatesbxxbbywh/" + sbbh,
            type: "put",
            async: false,
            data: $(".shiyrformName").serialize(),
            success: function (data) {
                // $.alert("设备表更新成功","温馨提示")
            }
        })
    }

    //通过设备编号更新设备信息表(不同form)
    function updateygxxb(xingm) {
        $.ajax({
            url: "/sbgl/ygxxb/updateygxxb/" + xingm,
            type: "put",
            async: false,
            data: $(".shiyrformName").serialize(),
            success: function (data) {
                $.alert("设备表更新成功", "温馨提示")
            }
        })
    }

    // 插入设备维护表
    function insertsbwhb() {
        $.confirm({
            title: '温馨提示',
            content: '确定添加吗？？？',
            buttons: {
                OK: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/sbwhb/insertsbwh',
                            method: 'POST',
                            data: $("#myModal5 form").serialize()
                        }).done(function (response) {
                            $("#myModal5").modal('hide');
                            window.location.href = window.location.href;
                        }).fail(function () {
                        });
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });
    }

    // 插入设备维护表
    function insertsbwhbnotgb() {
        $.ajax({
            url: "/sbgl/sbwhb/insertsbwh",
            type: 'POST',
            async: false,
            data: $("#myModal5 form").serialize(),
            success: function (result) {
                if (result != null) {
                }
            }
        });
    }

    function insertsbwhbforsj() {
        $.ajax({
            url: "/sbgl/sbwhb/insertsbwhforsj",
            type: 'POST',
            async: false,
            data: $("#sbshenjModal form").serialize(),
            success: function (result) {
                if (result != null) {
                }
            }
        });
    }

    function shengji() {
        var sbbh01 = document.getElementsByTagName("td")[0].firstChild.nodeValue;
        // $("#ncggdx01").attr("value", $("#sbsj_ncggdx").val())
        var ncdx = $("#xncggdx_sj").val()
        var yncdx = $("#yncggdx_sj").val()
        if (ncdx != yncdx) {
            $("#xncggdx_sj").val(ncdx + " G")
        } else {
            $("#xncggdx_sj").val(yncdx)
        }
        // genxsbxxb(sbbh01)
        // $.ajax({
        //     url: "/sbgl/sbsjb/insertshenji",
        //     type: 'POST',
        //     async: false,
        //     data: $("#sbshenjModal form").serialize(),
        //     success: function (result) {
        //         if (result != null) {
        //             alert("添加成功！！！");
        //             $("#sbshenjModal").modal('hide');
        //             window.location.href = window.location.href;
        //         }
        //     }
        // });

        var xzbxh = $("#xzbxh_sj").val()
        var xcpuxh = $("#xcpuxh_sj").val()
        var xncggdx = $("#xncggdx_sj").val()
        var xypdx1 = $("#xypdx1_sj").val()
        var xypdx2 = $("#xypdx2_sj").val()
        var xypdx3 = $("#xypdx3_sj").val()
        var xbeiz = $("#xbeiz_sj").val()
        var xxkxh = $("#xxkxh_sj").val()

        var yzbxh = $("#yzbxh_sj").val()
        var ycpuxh = $("#ycpuxh_sj").val()
        var yncggdx = $("#yncggdx_sj").val()
        var yypdx1 = $("#yypdx1_sj").val()
        var yypdx2 = $("#yypdx2_sj").val()
        var yypdx3 = $("#yypdx3_sj").val()
        var ybeiz = $("#ybeiz_sj").val()
        var yxkxh = $("#yxkxh_sj").val()

        $.confirm({
            title: '设备升级确认',
            content: '' +
                '<form action="" class="formName">' +
                '<div class="form-group">' +
                '<div><span id="zbxhy" ></span><span id="yzbxhid"></span><span id="zbxhw" ></span><span id="zbxh" ></span></div>' +
                '<div><span id="ncdxy" ></span><span id="yncdxid" ></span><span id="ncdxw" ></span><span id="ncdx" ></span></div>' +
                '<div><span id="cpuxhy"></span><span id="ycpuxhid"></span><span id="cpuxhw"></span><span id="cpuxh"></span></div>' +
                '<div><span id="xkxhy"></span><span id="yxkxhid"></span><span id="xkxhw"></span><span id="xkxh"></span></div>' +
                '<div><span id="ypdx1y"></span><span id="yypdx1id" ></span><span id="ypdx1w"></span><span id="ypdx1"></span></div>' +
                '<div><span id="ypdx2y"></span><span id="yypdx2id"></span><span id="ypdx2w"></span><span id="ypdx2"></span></div>' +
                '<div><span id="ypdx3y"></span><span id="yypdx3id"></span><span id="ypdx3w"></span><span id="ypdx3"></span></div>' +
                '<div><span id="beizy" ></span><span id="ybeizid" ></span><span id="beizw" ></span><span id="beiz" ></span></div>' +
                '</div>' +
                '</form>',
            buttons: {
                formSubmit: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        var zbxh = this.$content.find('#zbxh').html();
                        var ncdx = this.$content.find('#ncdx').html();
                        var xkxh = this.$content.find('#xkxh').html();
                        var cpuxh = this.$content.find('#cpuxh').html();
                        var ypdx1 = this.$content.find('#ypdx1').html();
                        var ypdx2 = this.$content.find('#ypdx2').html();
                        var ypdx3 = this.$content.find('#ypdx3').html();
                        var beiz = this.$content.find('#beiz').html();
                        var date = getdate();
                        // $("#xgyzz_sj").val()
                        // $("#xjjfa_sj").val()
                        // $("#xwhjl_sj").val()
                        // $("#xwhrq_sj").val()

                        if (zbxh != yzbxh) {
                            // $.alert('主板升级为:' + zbxh);
                            $("#xgzyy_sj").val("升级主板")
                            $("#xjjfa_sj").val("升级主板")
                            $("#xwhjl_sj").val(date + "主板：由原[" + yzbxh + "]变为：[" + zbxh + "]")
                            insertsbwhbforsj()
                        }
                        if (ncdx != yncggdx) {
                            // $.alert('内存升级为:' + ncdx);
                            $("#xgzyy_sj").val("升级内存")
                            $("#xjjfa_sj").val("升级内存")
                            $("#xwhjl_sj").val(date + "内存：由原[" + yncggdx + "]变为：[" + ncdx + "]")
                            insertsbwhbforsj()
                        }
                        if (cpuxh != ycpuxh) {
                            // $.alert('cpu升级为:' + cpuxh);
                            $("#xgzyy_sj").val("升级CPU")
                            $("#xjjfa_sj").val("升级CPU")
                            $("#xwhjl_sj").val(date + "CPU：由原[" + ycpuxh + "]变为：[" + cpuxh + "]")
                            insertsbwhbforsj()
                        }
                        if (xkxh != yxkxh) {
                            // $.alert('cpu升级为:' + cpuxh);
                            $("#xgzyy_sj").val("升级显卡")
                            $("#xjjfa_sj").val("升级显卡")
                            $("#xwhjl_sj").val(date + "显卡：由原[" + yxkxh + "]变为：[" + xkxh + "]")
                            insertsbwhbforsj()
                        }
                        if (ypdx1 != yypdx1) {
                            // $.alert('硬盘一升级为:' + ypdx1);
                            $("#xgzyy_sj").val("升级硬盘一")
                            $("#xjjfa_sj").val("升级硬盘一")
                            $("#xwhjl_sj").val(date + "硬盘一：由原[" + yypdx1 + "]变为：[" + ypdx1 + "]")
                            insertsbwhbforsj()
                        }
                        if (ypdx2 != yypdx2) {
                            // $.alert('硬盘二升级为:' + ypdx2);
                            $("#xgzyy_sj").val("升级硬盘二")
                            $("#xjjfa_sj").val("升级硬盘二")
                            $("#xwhjl_sj").val(date + "硬盘二：由原[" + yypdx2 + "]变为：[" + ypdx2 + "]")
                            insertsbwhbforsj()
                        }
                        if (ypdx3 != yypdx3) {
                            // $.alert('硬盘三升级为:' + ypdx3);
                            $("#xgzyy_sj").val("升级硬盘三")
                            $("#xjjfa_sj").val("升级硬盘三")
                            $("#xwhjl_sj").val(date + "硬盘三：由原[" + yypdx3 + "]变为：[" + ypdx3 + "]")
                            insertsbwhbforsj()
                        }

                        if (beiz != ybeiz) {
                            // $.alert('备注为:' + beiz);
                            $("#xgzyy_sj").val("备注修改")
                            $("#xjjfa_sj").val("备注修改")
                            $("#xwhjl_sj").val(date + "备注：由原[" + ybeiz + "]变为：[" + beiz + "]")
                        }
                        if (xkxh == yxkxh && beiz == ybeiz && ypdx3 == yypdx3 && ypdx2 == yypdx2 && ypdx1 == yypdx1 && cpuxh == ycpuxh && ncdx == yncggdx && zbxh == yzbxh) {
                            $.alert("你什么数据都没有更改,你不用打开设备升级模态框", "温馨提示", "温馨提示")
                        } else if (beiz.length >= 50) {
                            $.alert("你输入的备注信息太长了，只允许输入100个字符或50个汉字", "温馨提示")
                        } else {
                            genxsbxxb(sbbh01)
                            $("#sbbaofModal").modal('hide');
                            window.location.href = window.location.href;
                        }
                    }
                },
                cancel: function () {
                    //close
                },
            },
            onContentReady: function () {
                $("#zbxh").html(xzbxh)
                $("#ncdx").html(xncggdx)
                $("#xkxh").html(xxkxh)
                $("#cpuxh").html(xcpuxh)
                $("#ypdx1").html(xypdx1)
                $("#ypdx2").html(xypdx2)
                $("#ypdx3").html(xypdx3)
                $("#beiz").html(xbeiz)
                document.getElementById("zbxh").style.color = "red";
                document.getElementById("ncdx").style.color = "red";
                document.getElementById("xkxh").style.color = "red";
                document.getElementById("cpuxh").style.color = "red";
                document.getElementById("ypdx1").style.color = "red";
                document.getElementById("ypdx2").style.color = "red";
                document.getElementById("ypdx3").style.color = "red";
                document.getElementById("beiz").style.color = "red";

                $("#yzbxhid").html(yzbxh)
                $("#yncdxid").html(yncggdx)
                $("#yxkxhid").html(yxkxh)
                $("#ycpuxhid").html(ycpuxh)
                $("#yypdx1id").html(yypdx1)
                $("#yypdx2id").html(yypdx2)
                $("#yypdx3id").html(yypdx3)
                $("#ybeizid").html(ybeiz)
                document.getElementById("yzbxhid").style.color = "blue";
                document.getElementById("yncdxid").style.color = "blue";
                document.getElementById("yxkxhid").style.color = "blue";
                document.getElementById("ycpuxhid").style.color = "blue";
                document.getElementById("yypdx1id").style.color = "blue";
                document.getElementById("yypdx2id").style.color = "blue";
                document.getElementById("yypdx3id").style.color = "blue";
                document.getElementById("ybeizid").style.color = "blue";

                $("#zbxhy").html("主板:由原")
                $("#ncdxy").html("内存:由原")
                $("#xkxhy").html("显卡:由原")
                $("#cpuxhy").html("cpu:由原")
                $("#ypdx1y").html("硬盘一:由原")
                $("#ypdx2y").html("硬盘二:由原")
                $("#ypdx3y").html("硬盘三:由原")
                $("#beizy").html("备注:由原")

                $("#zbxhw").html("变为:")
                $("#ncdxw").html("变为:")
                $("#xkxhw").html("变为:")
                $("#cpuxhw").html("变为:")
                $("#ypdx1w").html("变为:")
                $("#ypdx2w").html("变为:")
                $("#ypdx3w").html("变为:")
                $("#beizw").html("变为:")

                if (xzbxh == yzbxh) {
                    document.getElementById("zbxh").style.display = "none"
                    document.getElementById("yzbxhid").style.display = "none"
                    document.getElementById("zbxhy").style.display = "none"
                    document.getElementById("zbxhw").style.display = "none"
                }
                if (xxkxh == yxkxh) {
                    document.getElementById("xkxh").style.display = "none"
                    document.getElementById("yxkxhid").style.display = "none"
                    document.getElementById("xkxhy").style.display = "none"
                    document.getElementById("xkxhw").style.display = "none"
                }
                if (xncggdx == yncggdx) {
                    document.getElementById("ncdx").style.display = "none"
                    document.getElementById("yncdxid").style.display = "none"
                    document.getElementById("ncdxy").style.display = "none"
                    document.getElementById("ncdxw").style.display = "none"
                }
                if (xcpuxh == ycpuxh) {
                    document.getElementById("cpuxh").style.display = "none"
                    document.getElementById("ycpuxhid").style.display = "none"
                    document.getElementById("cpuxhy").style.display = "none"
                    document.getElementById("cpuxhw").style.display = "none"
                }
                if (xypdx1 == yypdx1) {
                    document.getElementById("ypdx1").style.display = "none"
                    document.getElementById("yypdx1id").style.display = "none"
                    document.getElementById("ypdx1y").style.display = "none"
                    document.getElementById("ypdx1w").style.display = "none"
                }
                if (xypdx2 == yypdx2) {
                    document.getElementById("ypdx2").style.display = "none"
                    document.getElementById("yypdx2id").style.display = "none"
                    document.getElementById("ypdx2y").style.display = "none"
                    document.getElementById("ypdx2w").style.display = "none"
                }
                if (xypdx3 == yypdx3) {
                    document.getElementById("ypdx3").style.display = "none"
                    document.getElementById("yypdx3id").style.display = "none"
                    document.getElementById("ypdx3y").style.display = "none"
                    document.getElementById("ypdx3w").style.display = "none"
                }
                if (xbeiz == ybeiz) {
                    document.getElementById("beiz").style.display = "none"
                    document.getElementById("ybeizid").style.display = "none"
                    document.getElementById("beizy").style.display = "none"
                    document.getElementById("beizw").style.display = "none"
                }
            }
        });
    };

    function baofei() {
        var sbbh01 = document.getElementsByTagName("td")[0].firstChild.nodeValue;
        var whrq = $("#whrq_id_bf").val()
        var year = whrq.substr(0, 4)
        var month = whrq.substr(5, 2)
        var day = whrq.substr(8, 2)
        // var month = (whrq.substr(0, 4) - gmrq.substr(0, 4)) * 12 + (whrq.substr(5, 2) - gmrq.substr(5, 2));
        $("#whjl_bf").val(spid + "设备使用年限过长或损坏严重，于" + year + "年" + month + "月" + day + "日报废");
        // if ($.confirm("确认报废编号为[" + sbbh01 + "]的设备吗？","温馨提示")) {
        //     $.ajax({
        //         url: "/sbgl/sbxxb/updatesbxxbbybf/" + sbbh01,
        //         type: "put",
        //         async: false,
        //         data: $("#sbbaofModal form").serialize(),
        //         success: function (data) {
        //         }
        //     });
        //     $.ajax({
        //         url: "/sbgl/sbwhb/insertsbwhforsj",
        //         type: 'POST',
        //         async: false,
        //         data: $("#sbbaofModal form").serialize(),
        //         success: function (result) {
        //             // alert(result)
        //             if (result != null) {
        //                 confirm("温馨提示","报废成功！！！","#sbbaofModal")
        //                 window.location.href = window.location.href;
        //             }
        //         }
        //     });
        // }

        $.confirm({
            title: '温馨提示',
            content: '确认报废编号为[' + sbbh01 + ']的设备吗？',
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/sbxxb/updatesbxxbbybf/' + sbbh01,
                            method: 'PUT',
                            async: false,
                            data: $("#sbbaofModal form").serialize()
                        }).done(function (response) {
                            return $.ajax({
                                url: '/sbgl/sbwhb/insertsbwhforsj',
                                method: 'POST',
                                async: false,
                                data: $("#sbbaofModal form").serialize()
                            }).done(function (response) {
                                window.location.href = window.location.href;
                            }).fail(function () {
                            });
                        }).fail(function () {
                        });
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });

    };

    $('#add_jjfa').click(function () {
        $("#gsid_jjfa").val(gsid);
        $('#myModal5').modal('toggle');
        $("#tjjjfaModal").modal({
            backdrop: "static"
        });
        $.ajax({
            url: "/sbgl/whflb/getgzfl/" + gsid,
            type: 'GET',
            async: false,
            success: function (data) {
                $('#gzfl').empty();
                var options = "";   //字符串拼接
                $("#gzfl").append('<option value="">请选择故障分类</option>');
                for (var i in data) {  //遍历json数组
                    options += "<option value='" + data[i].gzfl + "'>" + data[i].gzfl + "</option>"
                    //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('#gzfl').append(options);
            }
        })
    });

    function tjjjfa() {
        // $.ajax({
        //     url: "/sbgl/whflb/insertfl",
        //     type: 'POST',
        //     async: false,
        //     data: $("#tjjjfaModal form").serialize(),
        //     success: function (result) {
        //         if (result != null) {
        //             confirm("温馨提示","添加成功！！！","#tjjjfaModal")
        //             show()
        //         }
        //     }
        // });

        $.confirm({
            title: '温馨提示',
            content: '确定添加吗？？？',
            buttons: {
                确定: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/whflb/insertfl',
                            method: 'POST',
                            async: false,
                            data: $("#tjjjfaModal form").serialize()
                        }).done(function (response) {
                            show()
                        }).fail(function () {
                        });
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });
    };


    $('#add_yg').click(function () {
        // var bmid = $("#selectbm option:selected").val();
        // if (bmid == "") {
        //     alert("请先选择部门名称,然后再点击添加部门员工！！！")
        // } else {
        //     $('#myModal5').modal('toggle');
        //     $("#ygModal").modal({
        //         backdrop: "static"
        //     });
        //     $("#yg_bmmc").val($("#selectbm option:selected").text())
        // }
        $.confirm({
            title: '人员管理!',
            content: '新添加员工请选择新增人员，使用人变更部门请选择人员变更，变更前一定要在上一个页面中选择部门',
            buttons: {
                confirm: {
                    text: '新增人员',
                    btnClass: 'btn-blue',
                    action: function () {
                        var bmid = $("#selectbm option:selected").val();
                        if (bmid == "0") {
                            $.alert("您在上个页面未选择部门，请关闭当前页面后选择使用人所在的部门", "温馨提示")
                        } else {
                            $('#myModal5').modal('toggle');
                            $.confirm({
                                title: '新增人员',
                                content: '' +
                                    '<form action="" class="formName">' +
                                    '<div class="form-group">' +
                                    '<div class=""><label>部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门：</label>' +
                                    '<input type="text" placeholder="请输入部门名称" readonly="readonly" class="bmmc" style="width: 80%;"/><input type="hidden" placeholder="请输入部门名称" name="bm" id="bmid_con"/></div>' +
                                    '<div class="" style="margin-top: 10px"><label>人员姓名：</label>' +
                                    '<input type="text" placeholder="请输入新增人员的姓名" id="yg_xingm" name="shiyr" style="width: 80%;" class="shiyr"/><input type="hidden" name="gsid" id="gsid_tj"></div>' +
                                    '</div>' +
                                    '<div class="" style="margin-top: -5px"><label>登录账号：</label>' +
                                    '<input type="text" placeholder="请输入新增人员的姓名" id="denglzh" name="loginName" style="width: 80%;" class="lgname"/></div>' +
                                    '</div>' +
                                    '<div class="" style="display: none"><label>登录密码：</label>' +
                                    '<input type="text" placeholder="请输入新增人员的姓名" id="denglmm" name="loginPassword" value="admin" style="width: 80%;" class="lgpassword"/></div>' +
                                    '</div>' +
                                    '</form>',
                                buttons: {
                                    确定: {
                                        text: '确定',
                                        btnClass: 'btn-blue',
                                        action: function () {
                                            // var name = this.$content.find('.name').val();
                                            // if(!name){
                                            //     $.alert('provide a valid name');
                                            //     return false;
                                            // }
                                            // $.alert('Your name is ' + name);
                                            var name = this.$content.find('.shiyr').val();
                                            var lgname = this.$content.find('.lgname').val();
                                            var bm = $("#bmid_con").val()
                                            if (!name || !lgname) {
                                                $.alert('您未输入人员姓名或登录账号，请认真输入', "温馨提示");
                                                return false
                                            }
                                            var isygxxb = cfpd("/sbgl/ygxxb/getygxxb/", gsid)
                                            var isshiyr = panduan("/sbgl/ygxxb/getbmbyshiyrandbm/", name, bm, gsid)
                                            var bms = []
                                            var names = []
                                            var lgnames = []
                                            for (var i in isygxxb) {
                                                if (bms.indexOf(bm) == -1) {
                                                    bms.push(isygxxb[i].bm)
                                                }
                                                names.push(isygxxb[i].shiyr)
                                                lgnames.push(isygxxb[i].loginName)
                                            }
                                            if (lgnames.indexOf(lgname) >= 0) {
                                                $.alert("登录账号重复了", "温馨提示")
                                                return false
                                            }
                                            if (isshiyr != '全公司上下查无此人') {
                                                $.alert("该员工信息已存在，若要继续添加联系系统管理员", "温馨提示")
                                                return false
                                            }
                                            return $.ajax({
                                                url: '/sbgl/ygxxb/insertyg',
                                                async: false,
                                                method: 'POST',
                                                data: $(".formName").serialize(),
                                            }).done(function (data) {
                                                $.confirm({
                                                    title: '温馨提示!',
                                                    content: '添加人员成功',
                                                    buttons: {
                                                        确定: {
                                                            text: '确定',
                                                            btnClass: 'btn-blue',
                                                            action: function () {
                                                                show()
                                                            }
                                                        },
                                                    }
                                                });
                                            }).fail(function () {
                                            })
                                        }
                                    },
                                    // cancel: function () {
                                    //     //close
                                    // },
                                    取消: {
                                        text: '取消',
                                        btnClass: 'btn-blue',
                                        action: function () {
                                            show()
                                        }
                                    }
                                },
                                onContentReady: function () {
                                    var bmid = $("#selectbm option:selected").val();
                                    var sbbh = ($("#sbbh_update_input_15").val())
                                    var bm = cfpd("/sbgl/sbxxb/getbm/", sbbh)
                                    $('.bmmc').val(bm)
                                    $("#bmid_con").val(bm)
                                    $("#gsid_tj").val(gsid)
                                }
                            });
                        }
                    }
                },
                yrbd: {
                    text: '人员变动',
                    btnClass: 'btn-blue',
                    action: function () {
                        var bmid = $("#selectbm option:selected").val();
                        if (bmid == "0") {
                            $.alert("您在上个页面未选择部门，请关闭当前页面后选择使用人所在的部门", "温馨提示")
                        } else {
                            $('#myModal5').modal('toggle');
                            $.confirm({
                                title: '人员变动',
                                content: '' +
                                    '<form action="" class="shiyrformName">' +
                                    '<div class="form-group">' +
                                    '<div class=""><label>原部门：</label>' +
                                    '<input type="text" readonly="readonly" placeholder="请输入部门名称" class="bmmc"/><input type="hidden" placeholder="请输入部门名称" id="bmid_con"/></div>' +
                                    '<div class=""><label>使用人：</label>' +
                                    '<input type="text" readonly="readonly" placeholder="请输入新增人员的姓名" id="yxingm"/><input type="hidden" id="shiyr_sbbh" name="sbbh"/></div>' +
                                    '<div class=""><label>现部门：</label>' +
                                    '<select type="text" id="xxingm" name="bm" style="width: 53%"></select></div>' +
                                    '</div>' +
                                    '</form>',
                                buttons: {
                                    确定: {
                                        text: '确定',
                                        btnClass: 'btn-blue',
                                        action: function () {
                                            var xbmid = $("#xxingm option:selected").val();//得到部门ID
                                            // var ygid = getygid($("#yxingm").val())//通过使用人的姓名得到id号
                                            var yxingm = $("#yxingm").val()
                                            if (!xbmid) {
                                                $.alert('您未选择使用人的部门，请选择', "温馨提示");
                                                return false
                                            } else {
                                                return $.ajax({
                                                    url: '/sbgl/ygxxb/updateygxxb/' + yxingm,
                                                    dataType: 'json',
                                                    method: 'PUT',
                                                    data: $(".shiyrformName").serialize(),
                                                }).done(function (data) {
                                                    updatesbxxbbywh(spid)
                                                    show()
                                                })
                                            }
                                        }
                                    },
                                    取消: {
                                        text: '取消',
                                        btnClass: 'btn-blue',
                                        action: function () {
                                            show()
                                        }
                                    },
                                },
                                onContentReady: function () {
                                    var sbbh = ($("#sbbh_update_input_15").val())
                                    var shiyr = cfpd("/sbgl/sbxxb/getshiyrbysbbh/", sbbh)
                                    var bm = cfpd("/sbgl/sbxxb/getbm/", sbbh)
                                    var bmid = $("#selectbm option:selected").val();
                                    $("#yxingm").val(shiyr)
                                    $('.bmmc').val(bm)
                                    $("#bmid_con").val(bm)
                                    $("#shiyr_sbbh").val(spid);
                                    return $.ajax({
                                        url: '/sbgl/ygxxb/getbm/' + gsid,
                                        dataType: 'json',
                                        method: 'get',
                                    }).done(function (data) {
                                        $('#xxingm').empty();
                                        var options = "";   //字符串拼接
                                        $('#xxingm').append('<option value="">请选择部门</option>');
                                        for (var i in data) {  //遍历json数组
                                            options += "<option value='" + data[i].bm + "'>" + data[i].bm + "</option>"
                                            //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                                        }
                                        $('#xxingm').append(options);
                                    })
                                }
                            });
                        }
                    }
                },
                取消: {
                    text: '取消',
                    btnClass: 'btn-blue',
                    action: function () {
                        show()
                    }
                }
            }
        });
    });

    $('#creat_zjm_btn').click(function () {
            var zjm = $('#yg_xingm').val();
            if (zjm == "") {
                $.alert("请先在姓名输入框中输入姓名后，再点击生成助记码！！！", "温馨提示")
            } else {
                $.ajax({
                    url: "/nc/ygxxb/getzjm/" + zjm,
                    type: 'GET',
                    success: function (result) {
                        $("#yg_zjm").val(result);
                    }
                })
            }
        }
    )

    $('#creat_zjm_btn_con').click(function () {
            var zjm = $('#yg_xingm').val();
            if (zjm == "") {
                $.alert("请先在姓名输入框中输入姓名后，再点击生成助记码！！！", "温馨提示")
            } else {
                $.ajax({
                    url: "/nc/ygxxb/getzjm/" + zjm,
                    type: 'GET',
                    success: function (result) {
                        $("#yg_zjm").val(result);
                    }
                })
            }
        }
    )

    function tjyg() {
        $("#yg_bmid").val($("#selectbm option:selected").val());
        $.ajax({
            url: "/nc/ygxxb/insertyg",
            type: 'POST',
            async: false,
            data: $("#ygModal form").serialize(),
            success: function (result) {
                if (result != null) {
                    confirm("温馨提示", "添加成功！！！", "#ygModal")
                    var bmid = $("#selectbm option:selected").val();
                    $('#shiyr01').val("");
                    $('#browsers').empty();
                    $.ajax({
                        url: "/sbgl/ygxxb/getygxx/" + bmid,
                        type: 'get',
                        success: function (data) {
                            $('#shiyr01').empty();
                            var options = "";   //字符串拼接
                            for (var i in data) {  //遍历json数组
                                options += "<option value='" + data[i].xingm + "'>" + data[i].zjm + "</option>"
                                //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                            }
                            $('#browsers').append(options);
                        },
                    });
                    $('#myModal5').modal('show');
                }
            }
        });
    };

    $(".dydjb").click(function () {
        var options = $('#djbdy').html();
        console.log(options)
        LODOP = getLodop();
        LODOP.PRINT_INIT("");
        LODOP.ADD_PRINT_HTML(5, 5, 2970, 2100, options);
        LODOP.PREVIEW();
    })

    function tishi(title, content, qdcallback, qxcallback) {
        $.confirm({
            title: title,
            content: content,
            buttons: {
                OK: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        qdcallback
                    }
                },
                cancel: {
                    text: '取消',
                    btnClass: 'btn-blue',
                    action: function () {
                        qxcallback
                    }
                },
            }
        });
    }

    function getksmc() {
        $.ajax({
            url: '/sbgl/gsxxb/getgsxxb/',
            type: 'GET',
            success: function (result) {
                $('.gsid').empty();
                var options = "";   //字符串拼接
                $('.gsid').append('<option value="">请选择公司名称</option>');
                for (var i in result) {  //遍历json数组
                    options += "<option value='" + result[i].gsid + "'>" + result[i].gs + "</option>"
                                //     // "<input type='radio' class='roles' name='roles' id='"+data[i].wjdcs+"' value='"+data[i].wjdc+"'>"+data[i].wjdc+"&nbsp;&nbsp;"
                }
                $('.gsid').append(options);
            }
        })
    }

//标签页选中事件
    $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
        e.target // 激活的标签页
        e.relatedTarget // 前⼀个激活的标签页
    })

    function kjdl() {
        var ksdlbh = $('#getgsid').val();
        $.ajax({
            url: '/sbgl/ygxxb/ksdlbh/' + ksdlbh,
            type: 'GET',
            success: function (result) {
                if (result){
                    var dlgsid=result[0].gsid;
                    $.ajax({
                        url: '/sbgl/sbxxb/getgsid/' + spid,
                        type: 'GET',
                        success: function (response) {
                            var cxgsid = response;
                            // window.location.href = window.location.href;
                            if(dlgsid==cxgsid){
                                window.location.href = window.location.href;
                            }else {
                                confirm("温馨提示","手机端你无权限访问该公司的信息")
                                window.location.href="/sbgl/"+spid;
                                // window.location.href = window.location.href;
                            }
                        }
                    })
                }else {
                    confirm("温馨提示","你输入的快速登录编码错误或不是管理员，你无权限访问该公司的消息")
                }
            }
        })
    }

    function zcdl() {
        var gsid = $('#shoujigsid').val();
        var loginName = $('#shoujiusername').val();
        var loginPassword = $('#shoujipassword').val();
        $.ajax({
            url: '/sbgl/ygxxb/login/' + gsid + '/' + loginName + '/' + loginPassword,
            type: 'GET',
            success: function (result) {
                if (result){
                    var dlgsid=result[0].gsid;
                    $.ajax({
                        url: '/sbgl/sbxxb/getgsid/' + spid,
                        type: 'GET',
                        success: function (response) {
                            var cxgsid = response;
                            // window.location.href = window.location.href;
                            if(dlgsid==cxgsid){
                                window.location.href = window.location.href;
                            }else {
                                confirm("温馨提示","手机端你无权限访问该公司的信息")
                                window.location.href="/sbgl/"+spid;
                                // window.location.href = window.location.href;
                            }
                        }
                    })
                }else {
                    confirm("温馨提示","你输入的快速登录编码错误或不是管理员，你无权限访问该公司的消息")
                }
            }
        })
    }

    function uploadById(row, index) {
        var curindex=0;
        $("#upload_Modal").modal({
            backdrop: "static"
        });
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
        var data_json = JSON.parse(data);
        var djbh = data_json[index].djbh
        var zjbh = data_json[index].zjbh
        $("#hidjbh").val(djbh)
        $("#hizjbh").val(zjbh)
        var initialPreview = [] ;
        var initialPreviewConfig = [] ;
        $.ajax({
            url: "/spkc/imgxxb/getfilename",
            type: 'GET',
            async: false,
            data: {
                djbh: $("#hidjbh").val(),
                gsbh: gsbh,
                zjbh: $("#hizjbh").val(),
                uploadyj: "单据",
                zllx:"shtx",
            },
            success: function (result) {
                if (result=="空"){
                    $(function () {
                        var control = $("#fileinput-demo-1");
                        var uploadUrl = "/spkc/imgxxb/upload";
                        control.fileinput({
                            language: 'zh', //设置语言
                            uploadUrl: uploadUrl, //上传的地址
                            uploadAsync:true,//默认异步上传
                            uploadExtraData:function (previewId,index) {//传递额外的参数
                                if (index!=undefined){
                                    var data={
                                        gsbh:gsbh,
                                        zllx:"shtx",
                                        zjbh:zjbh,
                                        username:sessionname,
                                        djbh:djbh,
                                        uploadyj:"单据",
                                        imgid:parseInt(index)+1,
                                    };
                                }
                                return data;
                            },
                            fileActionSettings:{
                                showRemove: true,
                                showUpload: false,
                                showDownload: true,
                            },

                            overwriteInitial: false,
                            initialPreviewAsData: true,
                            initialPreviewFileType: 'image', //'html', 'text', 'video', 'audio', 'flash', 'object'],
                            initialPreviewShowDelete:true,
                            // initialPreview:initialPreview,
                            // initialPreviewConfig:initialPreviewConfig,

                            allowedFileExtensions: ['png', 'jpeg', 'jpg', 'gif'],//接收的文件后缀
                            showUpload: true, //显示批量上传按钮
                            showCaption: true,//是否显示标题
                            // showPreview: true,//是否显示文件预览
                            browseClass: "btn btn-primary", //按钮样式
                            dropZoneEnabled: true,//是否显示拖拽区域
                            //minImageWidth: 50, //图片的最小宽度
                            //minImageHeight: 50,//图片的最小高度
                            //maxImageWidth: 1000,//图片的最大宽度
                            //maxImageHeight: 1000,//图片的最大高度
                            maxFileSize: 0,//单位为kb，如果为0表示不限制文件大小
                            minFileCount: 0,
                            maxFileCount: 100,
                            enctype: 'multipart/form-data',
                            showClose:false,
                            validateInitialCount: true,
                            previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
                            msgFilesTooMany: "选择上传的文件数量({n}) 超过允许的最大数值{m}！",
                        });
                    })
                }else {
                    var carouselImgs = [] ;
                    var fileNames=result;
                    // 获取协会图片介绍getInitFiles(taskInfo.taskFiles)
                    var initialPreviews = (fileNames ? fileNames.split(","):[] );
                    for (var i = 0; i < initialPreviews.length; i++) {
                        var fileName = initialPreviews[i] ;
                        if (fileName != null && fileName !=''){
                            initialPreview.push(fileName) ;
                            carouselImgs.push(fileName) ;
                        }
                    }
                    $.ajax({
                        url: "/spkc/imgxxb/getconfig",
                        type: 'GET',
                        async: false,
                        data: {
                            djbh: $("#hidjbh").val(),
                            gsbh: gsbh,
                            zjbh: $("#hizjbh").val(),
                            uploadyj: "单据",
                            zllx:"shtx",
                        },
                        success: function (datas) {
                            for (var i in datas) {  //遍历json数组
                                //     initialPreviewConfig: [
                                //         {caption: "transport-1.jpg", size: 329892, width: "120px", url: "{$url}", key: 1,extra: {id: 100,gsbh:gsbh}, zoomData: 'https://dummyimage.com/1920x1080/a0f.png&text=Transport+1', description: '<h5>NUMBER 1</h5> The first choice for transport. This is the future.'},
                                //         {caption: "transport-2.jpg", size: 872378, width: "120px", url: "{$url}", key: 2,extra: {id: 101,gsbh:gsbh}, zoomData: 'https://dummyimage.com/1920x1080/3a8.png&text=Transport+2', description: '<h5>NUMBER 2</h5> The second choice for transport. This is the future.'},
                                //         {caption: "transport-3.jpg", size: 632762, width: "120px", url: "{$url}", key: 3,extra: {id: 102,gsbh:gsbh}, zoomData: 'https://dummyimage.com/1920x1080/6ff.png&text=Transport+3', description: '<h5>NUMBER 3</h5> The third choice for transport. This is the future.'}
                                //     ]
                                var config = {};
                                config.caption=datas[i].filename
                                config.width="120px"
                                config.url="/spkc/imgxxb/configdeleteimg"
                                config.key= datas[i].imgid
                                config.extra={djbh: $("#hidjbh").val(), gsbh: gsbh,zjbh: $("#hizjbh").val(),uploadyj: "单据",zllx:"shtx",curcount: datas[i].curcount}
                                config.description='<h5>NUMBER 1</h5> The first choice for transport. This is the future.'
                                initialPreviewConfig.push(config)
                            }
                        }
                    })
                    $(function () {
                        var control = $("#fileinput-demo-1");
                        var uploadUrl = "/spkc/imgxxb/upload";
                        control.fileinput({
                            language: 'zh', //设置语言
                            uploadUrl: uploadUrl, //上传的地址
                            uploadAsync:true,//默认异步上传
                            uploadExtraData:function (previewId,index) {//传递额外的参数
                                if (index!=undefined){
                                    var data={
                                        gsbh:gsbh,
                                        zllx:"shtx",
                                        zjbh:zjbh,
                                        username:sessionname,
                                        djbh:djbh,
                                        uploadyj:"单据",
                                        imgid:parseInt(index)+1,
                                    };
                                }
                                return data;
                            },
                            fileActionSettings:{
                                showRemove: true,
                                showUpload: false,
                                showDownload: true,
                            },

                            overwriteInitial: false,
                            initialPreviewAsData: true,
                            initialPreviewFileType: 'image', //'html', 'text', 'video', 'audio', 'flash', 'object'],
                            initialPreviewShowDelete:true,
                            initialPreview:initialPreview,
                            initialPreviewConfig:initialPreviewConfig,

                            allowedFileExtensions: ['png', 'jpeg', 'jpg', 'gif'],//接收的文件后缀
                            showUpload: true, //显示批量上传按钮
                            showCaption: true,//是否显示标题
                            // showPreview: true,//是否显示文件预览
                            browseClass: "btn btn-primary", //按钮样式
                            dropZoneEnabled: true,//是否显示拖拽区域
                            //minImageWidth: 50, //图片的最小宽度
                            //minImageHeight: 50,//图片的最小高度
                            //maxImageWidth: 1000,//图片的最大宽度
                            //maxImageHeight: 1000,//图片的最大高度
                            maxFileSize: 0,//单位为kb，如果为0表示不限制文件大小
                            minFileCount: 0,
                            maxFileCount: 100,
                            enctype: 'multipart/form-data',
                            showClose:false,
                            validateInitialCount: true,
                            previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
                            msgFilesTooMany: "选择上传的文件数量({n}) 超过允许的最大数值{m}！",
                        });
                    })
                }
            }
        })
        var url = "";
        // $("#fileinput-demo-1").fileinput({
        //     'theme': 'explorer-fas',
        //     'uploadUrl': '#',
        //     overwriteInitial: false,
        //     initialPreviewAsData: true,
        //     initialPreview: [
        //         "/img/profile.jpg"
        //     ]
        // });
        // $('#fileinput-demo-1').fileinput({
        //     uploadUrl: '/spkc/saleorder/upload',
        //     //uploadUrl: 'http://localhost/plugins/test-upload',
        //     initialPreviewAsData: true,
        //     initialPreview: [
        //         "https://dummyimage.com/640x360/a0f.png&text=Transport+1",
        //         "https://dummyimage.com/640x360/3a8.png&text=Transport+2",
        //         "https://dummyimage.com/640x360/6ff.png&text=Transport+3"
        //     ],
        //     initialPreviewConfig: [
        //         {caption: "transport-1.jpg", size: 329892, width: "120px", url: "{$url}", key: 1,extra: {id: 100,gsbh:gsbh}, zoomData: 'https://dummyimage.com/1920x1080/a0f.png&text=Transport+1', description: '<h5>NUMBER 1</h5> The first choice for transport. This is the future.'},
        //         {caption: "transport-2.jpg", size: 872378, width: "120px", url: "{$url}", key: 2,extra: {id: 101,gsbh:gsbh}, zoomData: 'https://dummyimage.com/1920x1080/3a8.png&text=Transport+2', description: '<h5>NUMBER 2</h5> The second choice for transport. This is the future.'},
        //         {caption: "transport-3.jpg", size: 632762, width: "120px", url: "{$url}", key: 3,extra: {id: 102,gsbh:gsbh}, zoomData: 'https://dummyimage.com/1920x1080/6ff.png&text=Transport+3', description: '<h5>NUMBER 3</h5> The third choice for transport. This is the future.'}
        //     ]
        // })
    }
    $('#fileinput-demo-1').on('filesuccessremove', function(event, key, data) {
        $.ajax({
            url: "/spkc/imgxxb/deleteimgxxb",
            type: 'DELETE',
            async: false,
            data: {
                djbh: $("#hidjbh").val(),
                gsbh: gsbh,
                zjbh: $("#hizjbh").val(),
                uploadyj: "单据",
                zllx:"shtx",
                curcount: parseInt(data)+1,
            },
            success: function (result) {
                if (result > 0) {
                    $.alert("文件删除成功","温馨提示")
                }else {
                    $.alert("文件不存在删除失败","温馨提示")
                }
            }
        })
    });

    // 此事件在提交ajax请求上传之前触发。你可以在ajax提交之前使用此事件操纵uploadExtraData。只有通过每个缩略图上传按钮触发上传时，才可以使用以下附加参数：
    // previewId：预览窗口中每个文件的缩略图div父节点的id。
    // index：预览列表中加载的文件的基于0的顺序索引
    $('#fileinput-demo-1').on('filepreajax', function(event, previewId, index) {
        // console.log("filepreajax中的event值:"+event)
        // console.log("filepreajax中的previewId值："+previewId)
        // console.log("filepreajax中的index值："+index)
        // console.log('File pre ajax triggered');
    });

    // 此事件仅在ajax上传且上载每个缩略图文件之前触发。此事件在filepreajax之后伴随ajax的beforeSend事件触发。附加参数有：
    // data：这是一个数据对象（关联数组），它发送以下信息，其关键字是：
    // form：FormData，通过XHR2传递的对象（如果不可用，则为空对象）。
    // files: 数组，文件栈数组（如果不可用，则为空对象）。
    // filenames：数组，堆栈数组中每个文件的客户端文件名（如果不可用，则为空对象）。
    // filescount: int，所选文件的计数包括已经上传的文件（基本上返回getFilesCount方法的输出）。
    // extra：该插件的uploadExtraData设置（如果不可用，则为空对象）。
    // response：通过ajax响应发送的数据（如果不可用，则为空对象）。
    // reader：FileReader实例，如果可用。
    // jqXHR：用于此事务的jQuery XMLHttpRequest对象（如果可用）。
    // previewId：预览窗口中每个文件的缩略图div父节点的id。
    // index：预览列表中加载的文件的基于0的顺序索引
    $('#fileinput-demo-1').on('filepreupload', function(event, data, previewId, index) {
        var form = data.form, files = data.files, extra = data.extra,
            response = data.response, reader = data.reader;
        // console.log('File pre upload triggered');
    });

    // 此事件仅在ajax上传且上载每个缩略图文件之后触发。此事件只有是AJAX上传并在以下场景才会触发：
    // 当单击每个预览缩略图中的上传图标并且文件上传成功时，或者
    // 当你将uploadAsync设置为true并且已触发批量上传时。在这种情况下，fileuploaded事件在每个单独的选定文件成功上传之后被触发。
    // 此事件可用的其他参数：
    // data：这是一个数据对象（关联数组），它发送以下信息，其关键字是：
    // form：FormData，通过XHR2传递的对象（如果不可用，则为空对象）。
    // files: 数组，文件栈数组（如果不可用，则为空对象）。
    // filenames：数组，堆栈数组中每个文件的客户端文件名（如果不可用，则为空对象）。
    // filescount: int，所选文件的计数包括已经上传的文件（基本上返回getFilesCount方法的输出）。
    // extra：该插件的uploadExtraData设置（如果不可用，则为空对象）。
    // response：通过ajax响应发送的数据（如果不可用，则为空对象）。
    // reader：FileReader实例，如果可用。
    // jqXHR：用于此事务的jQuery XMLHttpRequest对象（如果可用）。
    // previewId：预览窗口中每个文件的缩略图div父节点的id。
    // index：预览列表中加载的文件的基于0的顺序索引
    $('#fileinput-demo-1').on('fileuploaded', function(event, data, previewId, index) {
        var form = data.form, files = data.files, extra = data.extra,
            response = data.response, reader = data.reader;
        // console.log('File uploaded triggered');
        console.log(data)
        console.log(form)
        console.log(files)
        console.log(response)
        // var file={
        //     previewId:previewId,
        //     fileName:data.response.fileName
        // };
        // taskFiles.push(file);//将每一个上传成功的文件放到初始的一个数组里，
        // console.log(taskFiles);
        $.ajax({
            url: "/spkc/imgxxb/updateimgid",
            type: 'PUT',
            async: false,
            data: {
                djbh: $("#hidjbh").val(),
                gsbh: gsbh,
                zjbh: $("#hizjbh").val(),
                uploadyj: "单据",
                zllx:"shtx",
                curcount: parseInt(index)+1,
                imgid: previewId
            },
            success: function (result) {
                if (result > 0) {

                }
            }
        })
    });

    // 在预览中加载文件后触发此事件。附加参数有：
    // file：文件对象实例
    // previewId：预览文件容器的标识符（id）
    // index：预览列表中加载的文件的基于0的顺序索引
    // reader：:FileReader实例，如果浏览器支持它
    $('#fileinput-demo-1').on('fileloaded', function(event, file, previewId, index, reader) {
        // console.log("fileloaded");
    });

    function xxxg() {
        $("#xxxgModal").modal({
            backdrop: "static"
        });
        $.ajax({
            url: "/sbgl/sbxxb/getsbwh/" + spid + "/" + gsid,
            type: 'GET',
            success: function (result) {
                $("#gsbh_xxxg").val(gsid);
                $("#sbbh_xxxg").val(result[0].sbbh);
                $("#sbmc_xxxg").val(result[0].sbmc);
                $("#pplx_xxxg").val(result[0].guige);
                $("#sccj_xxxg").val(result[0].shccj);
                $("#gmrq_xxxg").val(result[0].gmrq);
                $("#zbxh_xxxg").val(result[0].zbxh);
                $("#cpuxh_xxxg").val(result[0].cpuxh);
                $("#xsq_xxxg").val(result[0].xsqppcc);
                $("#xklx_xxxg").val(result[0].xkxh);
                $("#ncdx_xxxg").val(result[0].ncggdx);
                $("#ypxx_xxxg").val(result[0].ypdx);
                $("#ipdz_xxxg").val(result[0].ipdz);
                $("#macdz_xxxg").val(result[0].macdz);
                $("#sybm_xxxg").val(result[0].bm);
                $("#syrm_xxxg").val(result[0].shiyr);
                $("#id_xxxg").val(result[0].id);
                $("#beizbz_xxxg").val(result[0].beiz);
                $("#shjbz_xxxg").val(result[0].sjbeiz);
                $("#bfbz_xxxg").val(result[0].bfbeiz);
                $("#cwbz_xxxg").val(result[0].caiwbeiz);
            }
        });
    }

    function xxxg_bth() {
        $.confirm({
            title: '温馨提示',
            content: '更新设备信息吗？？？',
            buttons: {
                OK: {
                    text: '确定',
                    btnClass: 'btn-blue',
                    action: function () {
                        return $.ajax({
                            url: '/sbgl/sbxxb/updatesbxxbbyid',
                            method: 'put',
                            async: false,
                            data: $("#xxxg_form").serialize()
                        }).done(function (response) {
                            $("#xxxgModal").modal('hide');
                            window.location.href=window.location.href
                        }).fail(function () {
                        });
                    }
                },
                cacal: {
                    text: '取消',
                    btnClass: 'btn-red',
                    action: function () {
                    },
                },
            },
        });
    }

</script>
</body>
</html>